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

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

class C:
    def __init__(self, txt: str):
        self.z: B = None
        self.w: E = None
        self.o: B = None
        self.txt = txt

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

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

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

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

i.p = l
i.x = l
i.s = l
i.u = h
i.r = h
i.q = c
n.x = f
n.q = c
c.z = n
c.o = n
c.w = l
h.r = l
l.u = n
f.s = n
assert h.r.u.x.s.q.o.txt == "
class A:
    def __init__(self, txt: str):
        self.p: E = None
        self.u: D = None
        self.x: E = None
        self.q: C = None
        self.r: D = None
        self.s: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.z: B = None
        self.w: E = None
        self.o: B = None
        self.txt = txt

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

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

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

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

i.p = l
i.x = l
i.s = l
i.u = h
i.r = h
i.q = c
n.x = f
n.q = c
c.z = n
c.o = n
c.w = l
h.r = l
l.u = n
f.s = n
assert h.r.u.x.s.q.o.txt == "n"