class A:
    def __init__(self, txt: str):
        self.y: C = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.y: D = None
        self.p: A = None
        self.txt = txt

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

i.y = a
b.o = i
b.w = i
b.z = f
b.r = n
b.u = a
b.t = m
a.s = n
m.y = a
m.s = i
h.w = a
h.x = a
h.t = c
h.y = n
h.u = m
f.y = m
f.p = i
c.o = i
c.w = i
c.z = f
c.r = n
c.u = a
c.t = m
n.y = m
n.p = i
assert n.y.y.s.y.s.y.txt == "
class A:
    def __init__(self, txt: str):
        self.y: C = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.y: D = None
        self.p: A = None
        self.txt = txt

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

i.y = a
b.o = i
b.w = i
b.z = f
b.r = n
b.u = a
b.t = m
a.s = n
m.y = a
m.s = i
h.w = a
h.x = a
h.t = c
h.y = n
h.u = m
f.y = m
f.p = i
c.o = i
c.w = i
c.z = f
c.r = n
c.u = a
c.t = m
n.y = m
n.p = i
assert n.y.y.s.y.s.y.txt == "a"