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

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

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

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

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

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

e = A("e")
a = B("a")
h = C("h")
k = D("k")
c = E("c")
i = F("i")
b = D("b")
f = E("f")

e.s = f
a.s = c
h.x = a
h.t = k
k.s = c
k.p = h
k.r = i
c.t = f
c.r = f
c.y = h
c.s = h
c.p = i
c.u = i
i.r = c
b.s = f
b.p = h
b.r = i
f.t = c
f.r = c
f.y = h
f.s = h
f.p = i
f.u = i
assert f.t.y.t.r.r.y.t.txt == "
class A:
    def __init__(self, txt: str):
        self.s: E = None
        self.txt = txt

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

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

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

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

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

e = A("e")
a = B("a")
h = C("h")
k = D("k")
c = E("c")
i = F("i")
b = D("b")
f = E("f")

e.s = f
a.s = c
h.x = a
h.t = k
k.s = c
k.p = h
k.r = i
c.t = f
c.r = f
c.y = h
c.s = h
c.p = i
c.u = i
i.r = c
b.s = f
b.p = h
b.r = i
f.t = c
f.r = c
f.y = h
f.s = h
f.p = i
f.u = i
assert f.t.y.t.r.r.y.t.txt == "k"