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

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

class C:
    def __init__(self, txt: str):
        self.y: F = None
        self.u: F = None
        self.r: F = None
        self.t: A = None
        self.p: B = None
        self.z: A = None
        self.txt = txt

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.y: F = None
        self.u: F = None
        self.r: F = None
        self.t: A = None
        self.p: B = None
        self.z: A = None
        self.txt = txt

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

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

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

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

i.r = b
i.w = n
f.w = h
f.x = m
f.u = b
l.y = h
l.r = h
l.u = m
l.t = j
l.z = j
l.p = f
n.s = m
b.r = l
b.o = a
m.o = f
m.u = n
j.r = b
j.w = n
h.o = f
h.u = n
k.y = h
k.u = h
k.r = m
k.t = i
k.p = f
k.z = j
a.r = b
a.w = n
assert k.r.o.u.r.txt == "l"