class A:
    def __init__(self, txt: str):
        self.p: F = None
        self.v: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: D = None
        self.w: A = None
        self.u: A = None
        self.x: F = 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.z: A = None
        self.txt = txt

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

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

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

a.p = c
a.v = n
n.y = e
n.w = a
n.u = a
n.x = k
l.o = g
e.z = a
g.p = b
g.q = b
g.o = e
k.p = n
k.s = l
k.v = l
k.y = g
c.p = n
c.s = l
c.v = l
c.y = b
b.p = g
b.q = g
b.o = e
assert e.z.v.y.z.p.s.o.txt == "
class A:
    def __init__(self, txt: str):
        self.p: F = None
        self.v: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: D = None
        self.w: A = None
        self.u: A = None
        self.x: F = 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.z: A = None
        self.txt = txt

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

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

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

a.p = c
a.v = n
n.y = e
n.w = a
n.u = a
n.x = k
l.o = g
e.z = a
g.p = b
g.q = b
g.o = e
k.p = n
k.s = l
k.v = l
k.y = g
c.p = n
c.s = l
c.v = l
c.y = b
b.p = g
b.q = g
b.o = e
assert e.z.v.y.z.p.s.o.txt == "g"