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

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

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

class D:
    def __init__(self, txt: str):
        self.u: E = None
        self.r: C = None
        self.s: F = None
        self.w: A = None
        self.txt = txt

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.u: E = None
        self.r: C = None
        self.s: F = None
        self.w: A = None
        self.txt = txt

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

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

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

a.o = f
a.p = g
a.z = g
g.v = f
n.z = f
n.p = g
j.u = k
j.r = n
j.s = l
j.w = a
k.p = f
k.s = n
k.t = c
k.y = a
k.x = g
l.o = f
l.y = j
l.x = g
f.o = l
f.y = j
f.x = g
c.o = f
c.p = g
c.z = g
assert n.p.v.o.x.v.y.s.o.txt == "f"