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

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

class C:
    def __init__(self, txt: str):
        self.r: G = None
        self.v: G = None
        self.s: E = None
        self.o: E = None
        self.x: E = None
        self.q: E = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.q: C = None
        self.t: B = None
        self.z: C = None
        self.x: B = None
        self.txt = txt

m = A("m")
b = B("b")
l = C("l")
n = D("n")
i = E("i")
h = F("h")
k = G("k")
j = A("j")

m.x = j
m.v = k
b.w = k
b.o = i
b.v = l
b.r = h
l.r = k
l.v = k
l.s = i
l.o = i
l.x = i
l.q = i
n.o = i
n.y = m
n.q = k
n.w = j
n.t = b
i.z = n
i.w = b
h.r = n
k.q = l
k.z = l
k.t = b
k.x = b
j.x = m
j.v = k
assert j.x.v.t.v.v.t.r.txt == "
class A:
    def __init__(self, txt: str):
        self.x: A = None
        self.v: G = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.r: G = None
        self.v: G = None
        self.s: E = None
        self.o: E = None
        self.x: E = None
        self.q: E = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.q: C = None
        self.t: B = None
        self.z: C = None
        self.x: B = None
        self.txt = txt

m = A("m")
b = B("b")
l = C("l")
n = D("n")
i = E("i")
h = F("h")
k = G("k")
j = A("j")

m.x = j
m.v = k
b.w = k
b.o = i
b.v = l
b.r = h
l.r = k
l.v = k
l.s = i
l.o = i
l.x = i
l.q = i
n.o = i
n.y = m
n.q = k
n.w = j
n.t = b
i.z = n
i.w = b
h.r = n
k.q = l
k.z = l
k.t = b
k.x = b
j.x = m
j.v = k
assert j.x.v.t.v.v.t.r.txt == "h"