class A:
    def __init__(self, txt: str):
        self.o: D = None
        self.v: E = None
        self.x: F = None
        self.q: H = None
        self.t: E = None
        self.u: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: D = None
        self.z: E = None
        self.y: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: G = None
        self.p: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: H = None
        self.v: G = None
        self.p: B = None
        self.s: C = None
        self.t: F = None
        self.y: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: D = None
        self.z: A = None
        self.p: A = None
        self.q: B = None
        self.w: H = None
        self.s: C = None
        self.v: B = None
        self.y: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: C = None
        self.s: B = None
        self.r: F = None
        self.y: E = None
        self.q: H = None
        self.txt = txt

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

a = A("a")
d = B("d")
j = C("j")
b = D("b")
c = E("c")
m = F("m")
l = G("l")
i = H("i")

a.o = b
a.v = c
a.t = c
a.x = m
a.q = i
a.u = i
d.w = b
d.z = c
d.y = c
j.y = l
j.p = c
b.t = l
b.x = d
b.v = c
c.u = i
c.v = l
c.p = d
c.s = j
c.t = m
c.y = b
m.o = b
m.z = a
m.p = a
m.q = d
m.v = d
m.w = i
m.s = j
m.y = j
l.u = j
l.s = d
l.r = m
l.y = c
l.q = i
i.w = j
i.o = d
assert d.y.t.w.txt == "
class A:
    def __init__(self, txt: str):
        self.o: D = None
        self.v: E = None
        self.x: F = None
        self.q: H = None
        self.t: E = None
        self.u: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: D = None
        self.z: E = None
        self.y: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: G = None
        self.p: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: H = None
        self.v: G = None
        self.p: B = None
        self.s: C = None
        self.t: F = None
        self.y: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: D = None
        self.z: A = None
        self.p: A = None
        self.q: B = None
        self.w: H = None
        self.s: C = None
        self.v: B = None
        self.y: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: C = None
        self.s: B = None
        self.r: F = None
        self.y: E = None
        self.q: H = None
        self.txt = txt

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

a = A("a")
d = B("d")
j = C("j")
b = D("b")
c = E("c")
m = F("m")
l = G("l")
i = H("i")

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