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

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

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

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

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

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

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

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

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

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

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

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

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

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

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