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

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

class C:
    def __init__(self, txt: str):
        self.o: D = None
        self.r: H = None
        self.z: H = None
        self.v: B = None
        self.t: I = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.q: D = None
        self.p: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.v: C = None
        self.x: F = None
        self.t: I = None
        self.s: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: F = None
        self.t: D = None
        self.x: E = None
        self.s: B = None
        self.z: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.z: B = None
        self.x: F = None
        self.y: G = None
        self.q: A = None
        self.txt = txt

d = A("d")
h = B("h")
l = C("l")
m = D("m")
e = E("e")
c = F("c")
b = G("b")
j = H("j")
g = I("g")

d.q = h
d.r = m
h.u = g
h.w = d
l.o = m
l.r = j
l.z = j
l.v = h
l.t = g
m.r = g
m.z = c
e.q = m
e.p = m
c.t = j
c.r = e
c.v = e
c.s = l
c.w = h
b.v = l
b.x = c
b.s = c
b.t = g
j.y = c
j.t = m
j.x = e
j.s = h
j.z = b
g.z = h
g.x = c
g.y = b
g.q = d
assert j.s.w.r.z.v.txt == "
class A:
    def __init__(self, txt: str):
        self.q: B = None
        self.r: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.o: D = None
        self.r: H = None
        self.z: H = None
        self.v: B = None
        self.t: I = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.q: D = None
        self.p: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.v: C = None
        self.x: F = None
        self.t: I = None
        self.s: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: F = None
        self.t: D = None
        self.x: E = None
        self.s: B = None
        self.z: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.z: B = None
        self.x: F = None
        self.y: G = None
        self.q: A = None
        self.txt = txt

d = A("d")
h = B("h")
l = C("l")
m = D("m")
e = E("e")
c = F("c")
b = G("b")
j = H("j")
g = I("g")

d.q = h
d.r = m
h.u = g
h.w = d
l.o = m
l.r = j
l.z = j
l.v = h
l.t = g
m.r = g
m.z = c
e.q = m
e.p = m
c.t = j
c.r = e
c.v = e
c.s = l
c.w = h
b.v = l
b.x = c
b.s = c
b.t = g
j.y = c
j.t = m
j.x = e
j.s = h
j.z = b
g.z = h
g.x = c
g.y = b
g.q = d
assert j.s.w.r.z.v.txt == "e"