class A:
    def __init__(self, txt: str):
        self.t: G = None
        self.u: E = None
        self.x: D = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.o: B = None
        self.p: C = None
        self.z: C = None
        self.x: F = None
        self.txt = txt

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

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.o: B = None
        self.p: C = None
        self.z: C = None
        self.x: F = None
        self.txt = txt

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

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

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

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

a.t = j
a.u = d
a.x = k
n.w = h
h.v = a
k.o = n
k.p = h
k.z = h
k.x = m
d.o = n
d.z = n
d.w = k
d.y = k
d.r = h
d.t = j
m.r = d
m.p = n
j.w = k
j.x = a
j.q = m
l.o = n
l.z = n
l.w = k
l.y = k
l.r = h
l.t = j
assert n.w.v.t.x.t.q.r.txt == "d"