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

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

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

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

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

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

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

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

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

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

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

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

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

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

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