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

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

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

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

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

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

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

h.s = f
b.w = h
b.t = k
k.s = b
k.w = l
a.r = g
a.z = m
a.x = k
a.u = l
a.t = b
m.r = f
m.u = l
m.o = h
m.x = g
g.t = m
g.v = l
g.u = a
g.p = a
l.t = m
l.v = g
l.u = a
l.p = a
f.r = m
f.u = l
f.o = h
f.x = g
assert g.u.z.r.u.txt == "
class A:
    def __init__(self, txt: str):
        self.s: E = None
        self.txt = txt

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

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

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

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

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

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

h.s = f
b.w = h
b.t = k
k.s = b
k.w = l
a.r = g
a.z = m
a.x = k
a.u = l
a.t = b
m.r = f
m.u = l
m.o = h
m.x = g
g.t = m
g.v = l
g.u = a
g.p = a
l.t = m
l.v = g
l.u = a
l.p = a
f.r = m
f.u = l
f.o = h
f.x = g
assert g.u.z.r.u.txt == "l"