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

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

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

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

class E:
    def __init__(self, txt: str):
        self.t: A = None
        self.x: A = None
        self.q: C = None
        self.txt = txt

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.t: A = None
        self.x: A = None
        self.q: C = None
        self.txt = txt

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

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

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