class A:
    def __init__(self, txt: str):
        self.o: C = None
        self.y: C = None
        self.s: C = None
        self.v: D = None
        self.z: C = None
        self.txt = txt

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

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

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

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

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

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

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

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

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

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

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

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

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

c.o = h
c.y = h
c.s = h
c.z = h
c.v = b
a.s = f
a.z = c
a.r = b
a.q = h
h.r = a
b.y = h
b.s = h
b.p = a
b.x = g
b.r = g
f.y = b
g.y = c
g.u = c
g.p = b
g.q = h
g.r = a
assert h.r.q.r.z.s.txt == "h"