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

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

class C:
    def __init__(self, txt: str):
        self.w: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.u: A = None
        self.z: G = None
        self.t: A = None
        self.v: H = None
        self.y: C = None
        self.o: D = None
        self.p: F = None
        self.r: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: A = None
        self.txt = txt

b = A("b")
l = B("l")
a = C("a")
m = D("m")
j = E("j")
k = F("k")
c = G("c")
g = H("g")
n = G("n")

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

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

class C:
    def __init__(self, txt: str):
        self.w: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.u: A = None
        self.z: G = None
        self.t: A = None
        self.v: H = None
        self.y: C = None
        self.o: D = None
        self.p: F = None
        self.r: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: A = None
        self.txt = txt

b = A("b")
l = B("l")
a = C("a")
m = D("m")
j = E("j")
k = F("k")
c = G("c")
g = H("g")
n = G("n")

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