class A:
    def __init__(self, txt: str):
        self.x: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: F = None
        self.o: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: B = None
        self.txt = txt

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

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

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

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

l.x = n
e.q = m
e.o = n
n.v = e
f.t = e
f.q = e
f.y = n
f.u = n
g.x = m
g.u = m
g.s = n
g.q = f
m.w = a
m.o = a
m.r = f
m.y = g
b.x = n
a.q = m
a.o = n
d.x = m
d.u = m
d.s = n
d.q = f
assert e.q.o.q.r.txt == "
class A:
    def __init__(self, txt: str):
        self.x: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: F = None
        self.o: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: B = None
        self.txt = txt

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

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

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

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

l.x = n
e.q = m
e.o = n
n.v = e
f.t = e
f.q = e
f.y = n
f.u = n
g.x = m
g.u = m
g.s = n
g.q = f
m.w = a
m.o = a
m.r = f
m.y = g
b.x = n
a.q = m
a.o = n
d.x = m
d.u = m
d.s = n
d.q = f
assert e.q.o.q.r.txt == "f"