class A:
    def __init__(self, txt: str):
        self.v: H = None
        self.q: D = None
        self.t: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: D = None
        self.x: D = None
        self.u: C = None
        self.p: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: H = None
        self.q: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: C = None
        self.r: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: H = None
        self.x: A = None
        self.v: G = None
        self.p: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: C = None
        self.p: G = None
        self.u: E = None
        self.v: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: B = None
        self.y: G = None
        self.q: A = None
        self.w: D = None
        self.txt = txt

b = A("b")
a = B("a")
n = C("n")
d = D("d")
i = E("i")
h = F("h")
j = G("j")
m = H("m")
l = G("l")

b.v = m
b.q = d
b.t = i
a.t = d
a.x = d
a.u = n
a.p = l
n.u = m
n.q = l
d.q = b
i.y = n
i.r = a
h.y = m
h.x = b
h.v = j
h.p = i
j.w = n
j.p = l
j.u = i
j.v = b
m.r = a
m.y = j
m.q = b
m.w = d
l.w = n
l.p = j
l.u = i
l.v = b
assert a.t.q.v.y.u.r.t.txt == "
class A:
    def __init__(self, txt: str):
        self.v: H = None
        self.q: D = None
        self.t: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: D = None
        self.x: D = None
        self.u: C = None
        self.p: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: H = None
        self.q: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: C = None
        self.r: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: H = None
        self.x: A = None
        self.v: G = None
        self.p: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: C = None
        self.p: G = None
        self.u: E = None
        self.v: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: B = None
        self.y: G = None
        self.q: A = None
        self.w: D = None
        self.txt = txt

b = A("b")
a = B("a")
n = C("n")
d = D("d")
i = E("i")
h = F("h")
j = G("j")
m = H("m")
l = G("l")

b.v = m
b.q = d
b.t = i
a.t = d
a.x = d
a.u = n
a.p = l
n.u = m
n.q = l
d.q = b
i.y = n
i.r = a
h.y = m
h.x = b
h.v = j
h.p = i
j.w = n
j.p = l
j.u = i
j.v = b
m.r = a
m.y = j
m.q = b
m.w = d
l.w = n
l.p = j
l.u = i
l.v = b
assert a.t.q.v.y.u.r.t.txt == "d"