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

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

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

class D:
    def __init__(self, txt: str):
        self.w: B = None
        self.o: B = None
        self.q: C = None
        self.u: B = None
        self.y: F = None
        self.x: C = None
        self.s: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: D = None
        self.p: D = None
        self.s: A = None
        self.o: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: C = None
        self.z: D = None
        self.o: C = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.w: B = None
        self.o: B = None
        self.q: C = None
        self.u: B = None
        self.y: F = None
        self.x: C = None
        self.s: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: D = None
        self.p: D = None
        self.s: A = None
        self.o: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: C = None
        self.z: D = None
        self.o: C = None
        self.txt = txt

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

m.q = j
c.t = b
c.w = i
c.p = i
c.x = j
c.u = j
h.u = i
h.s = a
h.o = a
h.p = m
h.y = m
h.r = m
j.w = c
j.o = c
j.u = c
j.q = h
j.x = h
j.y = e
j.s = i
i.q = j
i.p = j
i.s = m
i.o = b
e.x = b
b.q = h
b.o = h
b.z = j
a.w = c
a.o = c
a.u = c
a.q = h
a.x = h
a.y = e
a.s = i
assert b.q.y.q.x.s.y.x.txt == "b"