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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.z: F = None
        self.s: C = None
        self.txt = txt

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

h.t = b
h.w = l
m.u = h
m.r = i
j.t = h
j.w = m
l.o = j
i.t = a
i.r = b
e.x = b
k.z = e
k.s = j
b.u = h
b.r = i
f.o = j
a.z = e
a.s = j
assert i.t.z.x.u.w.o.w.r.r.txt == "
class A:
    def __init__(self, txt: str):
        self.t: B = None
        self.w: D = None
        self.txt = txt

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.z: F = None
        self.s: C = None
        self.txt = txt

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

h.t = b
h.w = l
m.u = h
m.r = i
j.t = h
j.w = m
l.o = j
i.t = a
i.r = b
e.x = b
k.z = e
k.s = j
b.u = h
b.r = i
f.o = j
a.z = e
a.s = j
assert i.t.z.x.u.w.o.w.r.r.txt == "b"