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

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

class C:
    def __init__(self, txt: str):
        self.r: D = None
        self.p: D = None
        self.s: D = None
        self.x: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: E = None
        self.txt = txt

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

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

f = A("f")
m = B("m")
e = C("e")
a = D("a")
l = E("l")
g = F("g")

f.q = g
f.x = a
f.y = a
f.r = e
f.t = l
m.q = g
m.z = g
m.s = l
m.u = l
m.y = a
m.v = e
e.r = a
e.p = a
e.s = a
e.x = m
a.s = l
l.y = e
g.o = l
assert g.o.y.x.y.s.y.txt == "
class A:
    def __init__(self, txt: str):
        self.q: F = None
        self.x: D = None
        self.r: C = None
        self.y: D = None
        self.t: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.r: D = None
        self.p: D = None
        self.s: D = None
        self.x: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: E = None
        self.txt = txt

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

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

f = A("f")
m = B("m")
e = C("e")
a = D("a")
l = E("l")
g = F("g")

f.q = g
f.x = a
f.y = a
f.r = e
f.t = l
m.q = g
m.z = g
m.s = l
m.u = l
m.y = a
m.v = e
e.r = a
e.p = a
e.s = a
e.x = m
a.s = l
l.y = e
g.o = l
assert g.o.y.x.y.s.y.txt == "e"