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

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

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

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

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

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

n = A("n")
g = B("g")
b = C("b")
i = D("i")
e = E("e")
h = F("h")
c = F("c")

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

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

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

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

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

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

n = A("n")
g = B("g")
b = C("b")
i = D("i")
e = E("e")
h = F("h")
c = F("c")

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