class A:
    def __init__(self, txt: str):
        self.u: E = None
        self.x: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: F = None
        self.t: D = None
        self.u: E = None
        self.v: A = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.y: C = None
        self.p: C = None
        self.u: B = None
        self.v: B = None
        self.x: F = None
        self.o: F = None
        self.txt = txt

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

h = A("h")
c = B("c")
e = C("e")
d = D("d")
k = E("k")
a = F("a")
g = A("g")
b = A("b")
f = D("f")

h.u = k
h.x = f
c.w = a
c.t = f
c.u = k
c.v = g
e.w = f
e.y = k
e.s = k
e.v = c
e.p = c
e.t = a
d.p = e
d.q = e
d.t = e
d.y = k
d.u = a
k.y = e
k.p = e
k.u = c
k.v = c
k.x = a
k.o = a
a.q = f
a.u = d
a.y = k
g.u = k
g.x = f
b.u = k
b.x = f
f.p = e
f.q = e
f.t = e
f.y = k
f.u = a
assert b.x.u.y.txt == "
class A:
    def __init__(self, txt: str):
        self.u: E = None
        self.x: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: F = None
        self.t: D = None
        self.u: E = None
        self.v: A = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.y: C = None
        self.p: C = None
        self.u: B = None
        self.v: B = None
        self.x: F = None
        self.o: F = None
        self.txt = txt

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

h = A("h")
c = B("c")
e = C("e")
d = D("d")
k = E("k")
a = F("a")
g = A("g")
b = A("b")
f = D("f")

h.u = k
h.x = f
c.w = a
c.t = f
c.u = k
c.v = g
e.w = f
e.y = k
e.s = k
e.v = c
e.p = c
e.t = a
d.p = e
d.q = e
d.t = e
d.y = k
d.u = a
k.y = e
k.p = e
k.u = c
k.v = c
k.x = a
k.o = a
a.q = f
a.u = d
a.y = k
g.u = k
g.x = f
b.u = k
b.x = f
f.p = e
f.q = e
f.t = e
f.y = k
f.u = a
assert b.x.u.y.txt == "k"