class A:
    def __init__(self, txt: str):
        self.z: F = None
        self.x: C = None
        self.t: E = None
        self.y: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.r: D = None
        self.w: B = None
        self.t: F = None
        self.q: B = None
        self.txt = txt

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

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

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

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

k.z = a
k.y = a
k.x = m
k.t = f
j.x = f
j.o = k
m.r = b
m.w = j
m.q = j
m.t = a
b.t = k
b.q = k
b.x = k
b.z = a
b.r = h
b.s = c
h.q = j
a.s = h
a.x = m
f.q = j
c.t = k
c.q = k
c.x = k
c.z = a
c.r = f
c.s = b
assert b.s.s.r.txt == "
class A:
    def __init__(self, txt: str):
        self.z: F = None
        self.x: C = None
        self.t: E = None
        self.y: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.r: D = None
        self.w: B = None
        self.t: F = None
        self.q: B = None
        self.txt = txt

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

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

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

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

k.z = a
k.y = a
k.x = m
k.t = f
j.x = f
j.o = k
m.r = b
m.w = j
m.q = j
m.t = a
b.t = k
b.q = k
b.x = k
b.z = a
b.r = h
b.s = c
h.q = j
a.s = h
a.x = m
f.q = j
c.t = k
c.q = k
c.x = k
c.z = a
c.r = f
c.s = b
assert b.s.s.r.txt == "h"