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

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

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

class D:
    def __init__(self, txt: str):
        self.r: B = None
        self.w: E = None
        self.txt = txt

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

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

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

a = A("a")
e = B("e")
k = C("k")
l = D("l")
g = E("g")
j = F("j")
n = G("n")
b = A("b")

a.p = k
e.r = j
e.x = j
e.o = l
e.u = k
k.y = j
l.r = e
l.w = g
g.r = j
g.q = j
g.w = j
g.t = l
g.u = b
g.y = e
j.o = g
j.v = k
j.q = l
n.p = k
b.p = k
assert a.p.y.v.y.v.y.txt == "
class A:
    def __init__(self, txt: str):
        self.p: C = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.r: B = None
        self.w: E = None
        self.txt = txt

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

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

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

a = A("a")
e = B("e")
k = C("k")
l = D("l")
g = E("g")
j = F("j")
n = G("n")
b = A("b")

a.p = k
e.r = j
e.x = j
e.o = l
e.u = k
k.y = j
l.r = e
l.w = g
g.r = j
g.q = j
g.w = j
g.t = l
g.u = b
g.y = e
j.o = g
j.v = k
j.q = l
n.p = k
b.p = k
assert a.p.y.v.y.v.y.txt == "j"