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

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

class C:
    def __init__(self, txt: str):
        self.q: A = None
        self.y: A = None
        self.z: A = None
        self.s: E = None
        self.r: E = None
        self.u: D = None
        self.txt = txt

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

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

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

l = A("l")
m = B("m")
d = C("d")
i = D("i")
f = E("f")
h = F("h")
n = E("n")
e = D("e")
k = E("k")

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

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

class C:
    def __init__(self, txt: str):
        self.q: A = None
        self.y: A = None
        self.z: A = None
        self.s: E = None
        self.r: E = None
        self.u: D = None
        self.txt = txt

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

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

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

l = A("l")
m = B("m")
d = C("d")
i = D("i")
f = E("f")
h = F("h")
n = E("n")
e = D("e")
k = E("k")

l.r = d
l.w = d
l.u = n
l.s = f
m.w = l
m.x = l
m.p = l
m.t = n
m.s = h
d.q = l
d.y = l
d.z = l
d.s = k
d.r = f
d.u = e
i.u = e
f.z = l
h.u = k
h.o = m
h.q = f
n.z = l
e.u = i
k.z = l
assert l.r.u.u.u.u.u.u.u.txt == "e"