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

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

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

class D:
    def __init__(self, txt: str):
        self.s: B = None
        self.t: F = None
        self.p: C = None
        self.x: D = None
        self.q: F = None
        self.y: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.p: E = None
        self.u: E = None
        self.x: B = None
        self.q: E = None
        self.txt = txt

c = A("c")
b = B("b")
a = C("a")
f = D("f")
m = E("m")
h = F("h")
l = F("l")
k = D("k")

c.y = h
c.q = l
b.x = c
b.t = h
a.t = m
a.r = m
a.s = f
a.y = h
f.s = b
f.y = b
f.t = l
f.p = a
f.x = k
f.q = h
m.w = c
m.q = l
h.p = m
h.u = m
h.q = m
h.x = b
l.p = m
l.u = m
l.q = m
l.x = b
k.s = b
k.y = b
k.t = h
k.p = a
k.x = f
k.q = l
assert l.x.x.y.x.t.x.txt == "
class A:
    def __init__(self, txt: str):
        self.y: F = None
        self.q: F = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.s: B = None
        self.t: F = None
        self.p: C = None
        self.x: D = None
        self.q: F = None
        self.y: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.p: E = None
        self.u: E = None
        self.x: B = None
        self.q: E = None
        self.txt = txt

c = A("c")
b = B("b")
a = C("a")
f = D("f")
m = E("m")
h = F("h")
l = F("l")
k = D("k")

c.y = h
c.q = l
b.x = c
b.t = h
a.t = m
a.r = m
a.s = f
a.y = h
f.s = b
f.y = b
f.t = l
f.p = a
f.x = k
f.q = h
m.w = c
m.q = l
h.p = m
h.u = m
h.q = m
h.x = b
l.p = m
l.u = m
l.q = m
l.x = b
k.s = b
k.y = b
k.t = h
k.p = a
k.x = f
k.q = l
assert l.x.x.y.x.t.x.txt == "b"