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

class B:
    def __init__(self, txt: str):
        self.r: B = None
        self.z: E = None
        self.w: G = None
        self.u: D = None
        self.t: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.z: F = None
        self.r: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: G = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.r: B = None
        self.z: E = None
        self.w: G = None
        self.u: D = None
        self.t: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.z: F = None
        self.r: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: G = None
        self.txt = txt

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

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

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

g.o = c
g.v = a
c.r = a
c.z = k
c.w = n
c.u = d
c.t = b
b.y = n
b.s = n
b.v = g
b.t = g
b.r = c
b.p = a
b.o = d
d.z = l
d.r = l
k.r = n
l.v = b
l.u = g
n.v = b
n.t = l
h.v = b
h.u = g
a.r = c
a.z = k
a.w = n
a.u = d
a.t = b
assert l.v.s.t.u.o.txt == "c"