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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.w: C = None
        self.x: B = None
        self.s: D = None
        self.o: C = None
        self.txt = txt

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.w: C = None
        self.x: B = None
        self.s: D = None
        self.o: C = None
        self.txt = txt

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

i.t = a
i.s = g
i.p = f
h.y = k
l.r = h
l.u = h
l.p = f
l.s = k
l.x = k
l.o = i
m.p = g
m.w = g
m.x = h
m.u = k
m.r = f
f.u = l
k.w = l
k.o = l
k.x = h
k.s = g
c.t = i
c.s = g
c.p = f
g.p = m
g.w = m
g.x = h
g.u = k
g.r = f
a.t = i
a.s = g
a.p = f
assert k.x.y.x.y.s.r.txt == "f"