class A:
    def __init__(self, txt: str):
        self.o: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: H = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: F = None
        self.z: B = None
        self.r: G = None
        self.q: B = None
        self.p: A = None
        self.w: C = None
        self.t: H = None
        self.y: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.y: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: F = None
        self.q: E = None
        self.o: H = None
        self.y: F = None
        self.t: C = None
        self.w: E = None
        self.z: E = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.r: H = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: F = None
        self.z: B = None
        self.r: G = None
        self.q: B = None
        self.p: A = None
        self.w: C = None
        self.t: H = None
        self.y: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.y: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: F = None
        self.q: E = None
        self.o: H = None
        self.y: F = None
        self.t: C = None
        self.w: E = None
        self.z: E = None
        self.txt = txt

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

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

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