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

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

class C:
    def __init__(self, txt: str):
        self.r: C = None
        self.u: F = None
        self.p: A = None
        self.x: C = None
        self.s: E = None
        self.o: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: C = None
        self.u: E = None
        self.p: A = None
        self.o: B = None
        self.v: A = None
        self.y: B = None
        self.s: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: A = None
        self.r: D = None
        self.t: D = None
        self.y: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: B = None
        self.q: G = None
        self.v: A = None
        self.u: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: D = None
        self.o: A = None
        self.x: D = None
        self.txt = txt

b = A("b")
i = B("i")
h = C("h")
m = D("m")
k = E("k")
e = F("e")
d = G("d")
a = C("a")

b.q = i
b.r = m
i.x = m
i.q = m
i.u = a
h.r = a
h.x = a
h.u = e
h.p = b
h.s = k
h.o = k
m.z = a
m.u = k
m.p = b
m.v = b
m.o = i
m.y = i
m.s = d
k.x = b
k.r = m
k.t = m
k.y = m
e.y = i
e.q = d
e.v = b
e.u = b
d.v = m
d.x = m
d.o = b
a.r = h
a.x = h
a.u = e
a.p = b
a.s = k
a.o = k
assert h.u.q.v.z.x.x.u.q.txt == "
class A:
    def __init__(self, txt: str):
        self.q: B = None
        self.r: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.r: C = None
        self.u: F = None
        self.p: A = None
        self.x: C = None
        self.s: E = None
        self.o: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: C = None
        self.u: E = None
        self.p: A = None
        self.o: B = None
        self.v: A = None
        self.y: B = None
        self.s: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: A = None
        self.r: D = None
        self.t: D = None
        self.y: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: B = None
        self.q: G = None
        self.v: A = None
        self.u: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: D = None
        self.o: A = None
        self.x: D = None
        self.txt = txt

b = A("b")
i = B("i")
h = C("h")
m = D("m")
k = E("k")
e = F("e")
d = G("d")
a = C("a")

b.q = i
b.r = m
i.x = m
i.q = m
i.u = a
h.r = a
h.x = a
h.u = e
h.p = b
h.s = k
h.o = k
m.z = a
m.u = k
m.p = b
m.v = b
m.o = i
m.y = i
m.s = d
k.x = b
k.r = m
k.t = m
k.y = m
e.y = i
e.q = d
e.v = b
e.u = b
d.v = m
d.x = m
d.o = b
a.r = h
a.x = h
a.u = e
a.p = b
a.s = k
a.o = k
assert h.u.q.v.z.x.x.u.q.txt == "d"