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

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: C = None
        self.txt = txt

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

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

k.r = i
k.s = i
k.z = m
e.y = a
e.u = a
e.s = i
i.o = f
i.q = h
m.s = h
h.v = l
a.z = f
a.u = h
a.q = k
f.y = a
f.u = a
f.s = l
g.r = l
g.z = m
g.s = i
l.o = e
l.q = h
assert f.u.u.v.o.s.q.v.o.txt == "
class A:
    def __init__(self, txt: str):
        self.r: C = None
        self.z: D = None
        self.s: C = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: C = None
        self.txt = txt

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

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

k.r = i
k.s = i
k.z = m
e.y = a
e.u = a
e.s = i
i.o = f
i.q = h
m.s = h
h.v = l
a.z = f
a.u = h
a.q = k
f.y = a
f.u = a
f.s = l
g.r = l
g.z = m
g.s = i
l.o = e
l.q = h
assert f.u.u.v.o.s.q.v.o.txt == "e"