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

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

class C:
    def __init__(self, txt: str):
        self.p: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: B = None
        self.v: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.y: B = None
        self.v: F = None
        self.txt = txt

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

l.r = k
l.z = f
l.x = e
l.o = h
e.p = l
e.u = a
e.r = d
e.x = h
d.p = h
k.q = e
k.v = d
n.y = f
n.r = k
n.s = k
n.x = m
h.y = c
h.v = m
c.p = l
c.u = n
c.r = d
c.x = m
f.y = a
f.r = k
f.s = k
f.x = h
a.y = n
a.r = k
a.s = k
a.x = m
m.y = e
m.v = h
assert h.v.y.r.p.y.r.p.y.r.txt == "
class A:
    def __init__(self, txt: str):
        self.r: D = None
        self.z: E = None
        self.x: B = None
        self.o: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.p: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: B = None
        self.v: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.y: B = None
        self.v: F = None
        self.txt = txt

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

l.r = k
l.z = f
l.x = e
l.o = h
e.p = l
e.u = a
e.r = d
e.x = h
d.p = h
k.q = e
k.v = d
n.y = f
n.r = k
n.s = k
n.x = m
h.y = c
h.v = m
c.p = l
c.u = n
c.r = d
c.x = m
f.y = a
f.r = k
f.s = k
f.x = h
a.y = n
a.r = k
a.s = k
a.x = m
m.y = e
m.v = h
assert h.v.y.r.p.y.r.p.y.r.txt == "d"