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

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

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

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

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

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

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

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

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

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

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

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

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

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

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