class A:
    def __init__(self, txt: str):
        self.o: D = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.u: E = None
        self.o: A = None
        self.q: C = None
        self.p: E = None
        self.z: D = None
        self.x: A = None
        self.txt = txt

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

f.o = c
i.t = n
i.s = n
i.q = n
i.r = f
i.v = f
i.x = c
b.u = f
b.r = f
b.x = n
b.y = n
c.o = n
c.z = h
c.s = b
j.u = b
j.v = c
n.u = j
n.p = j
n.o = f
n.x = f
n.q = b
n.z = c
h.t = n
h.s = n
h.q = n
h.r = f
h.v = f
h.x = c
assert b.x.z.z.s.txt == "
class A:
    def __init__(self, txt: str):
        self.o: D = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.u: E = None
        self.o: A = None
        self.q: C = None
        self.p: E = None
        self.z: D = None
        self.x: A = None
        self.txt = txt

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

f.o = c
i.t = n
i.s = n
i.q = n
i.r = f
i.v = f
i.x = c
b.u = f
b.r = f
b.x = n
b.y = n
c.o = n
c.z = h
c.s = b
j.u = b
j.v = c
n.u = j
n.p = j
n.o = f
n.x = f
n.q = b
n.z = c
h.t = n
h.s = n
h.q = n
h.r = f
h.v = f
h.x = c
assert b.x.z.z.s.txt == "n"