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

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

class C:
    def __init__(self, txt: str):
        self.u: E = None
        self.r: E = None
        self.z: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: A = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.x: G = None
        self.v: G = None
        self.s: C = None
        self.z: A = None
        self.u: E = None
        self.txt = txt

i = A("i")
j = B("j")
k = C("k")
m = D("m")
g = E("g")
f = F("f")
d = G("d")
e = G("e")
h = C("h")

i.t = k
j.p = e
j.t = m
k.u = g
k.r = g
k.z = m
m.z = i
g.r = i
f.w = g
f.q = k
f.r = h
f.v = m
f.z = d
d.x = e
d.v = e
d.s = h
d.z = i
d.u = g
e.x = d
e.v = d
e.s = k
e.z = i
e.u = g
h.u = g
h.r = g
h.z = m
assert e.s.u.r.t.u.r.t.z.z.txt == "
class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.u: E = None
        self.r: E = None
        self.z: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: A = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.x: G = None
        self.v: G = None
        self.s: C = None
        self.z: A = None
        self.u: E = None
        self.txt = txt

i = A("i")
j = B("j")
k = C("k")
m = D("m")
g = E("g")
f = F("f")
d = G("d")
e = G("e")
h = C("h")

i.t = k
j.p = e
j.t = m
k.u = g
k.r = g
k.z = m
m.z = i
g.r = i
f.w = g
f.q = k
f.r = h
f.v = m
f.z = d
d.x = e
d.v = e
d.s = h
d.z = i
d.u = g
e.x = d
e.v = d
e.s = k
e.z = i
e.u = g
h.u = g
h.r = g
h.z = m
assert e.s.u.r.t.u.r.t.z.z.txt == "i"