class A:
    def __init__(self, txt: str):
        self.s: D = None
        self.x: C = None
        self.o: C = None
        self.z: E = None
        self.w: C = None
        self.p: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.u: D = None
        self.q: F = None
        self.y: D = None
        self.v: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: C = None
        self.z: C = None
        self.t: F = None
        self.q: F = None
        self.o: B = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.u: D = None
        self.q: F = None
        self.y: D = None
        self.v: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: C = None
        self.z: C = None
        self.t: F = None
        self.q: F = None
        self.o: B = None
        self.txt = txt

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

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

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