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

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

class C:
    def __init__(self, txt: str):
        self.o: A = None
        self.x: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: G = None
        self.t: F = None
        self.v: F = None
        self.r: A = None
        self.q: B = None
        self.txt = txt

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.o: A = None
        self.x: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: G = None
        self.t: F = None
        self.v: F = None
        self.r: A = None
        self.q: B = None
        self.txt = txt

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

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

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

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

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