class A:
    def __init__(self, txt: str):
        self.t: B = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.q: D = None
        self.w: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: E = None
        self.p: A = None
        self.w: D = None
        self.y: D = None
        self.x: C = None
        self.u: B = None
        self.r: E = None
        self.txt = txt

m = A("m")
g = B("g")
h = C("h")
c = D("c")
e = E("e")
f = F("f")
b = G("b")
n = C("n")
l = B("l")

m.t = g
g.r = c
g.w = c
g.y = b
g.q = m
g.o = f
h.s = f
h.r = f
h.u = e
h.x = g
c.q = h
c.z = h
c.o = m
c.u = b
c.r = l
c.p = e
e.q = c
e.w = b
f.z = e
b.q = e
b.r = e
b.p = m
b.w = c
b.y = c
b.x = h
b.u = l
n.s = f
n.r = f
n.u = e
n.x = g
l.r = c
l.w = c
l.y = b
l.q = m
l.o = f
assert m.t.y.x.x.q.t.o.txt == "
class A:
    def __init__(self, txt: str):
        self.t: B = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.q: D = None
        self.w: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: E = None
        self.p: A = None
        self.w: D = None
        self.y: D = None
        self.x: C = None
        self.u: B = None
        self.r: E = None
        self.txt = txt

m = A("m")
g = B("g")
h = C("h")
c = D("c")
e = E("e")
f = F("f")
b = G("b")
n = C("n")
l = B("l")

m.t = g
g.r = c
g.w = c
g.y = b
g.q = m
g.o = f
h.s = f
h.r = f
h.u = e
h.x = g
c.q = h
c.z = h
c.o = m
c.u = b
c.r = l
c.p = e
e.q = c
e.w = b
f.z = e
b.q = e
b.r = e
b.p = m
b.w = c
b.y = c
b.x = h
b.u = l
n.s = f
n.r = f
n.u = e
n.x = g
l.r = c
l.w = c
l.y = b
l.q = m
l.o = f
assert m.t.y.x.x.q.t.o.txt == "f"