class A:
    def __init__(self, txt: str):
        self.v: G = None
        self.y: D = None
        self.r: E = None
        self.z: D = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.u: E = None
        self.v: B = None
        self.y: G = None
        self.o: A = None
        self.t: G = None
        self.q: F = None
        self.w: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: B = None
        self.o: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: E = None
        self.q: D = None
        self.w: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: C = None
        self.t: A = None
        self.x: B = None
        self.q: F = None
        self.r: E = None
        self.v: F = None
        self.p: F = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.u: E = None
        self.v: B = None
        self.y: G = None
        self.o: A = None
        self.t: G = None
        self.q: F = None
        self.w: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: B = None
        self.o: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: E = None
        self.q: D = None
        self.w: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: C = None
        self.t: A = None
        self.x: B = None
        self.q: F = None
        self.r: E = None
        self.v: F = None
        self.p: F = None
        self.txt = txt

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

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