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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.u: A = None
        self.t: B = None
        self.s: C = None
        self.q: D = None
        self.txt = txt

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

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

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.u: A = None
        self.t: B = None
        self.s: C = None
        self.q: D = None
        self.txt = txt

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

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

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

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