class A:
    def __init__(self, txt: str):
        self.y: H = None
        self.u: C = None
        self.p: C = None
        self.v: C = None
        self.x: H = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.u: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: B = None
        self.r: C = None
        self.w: C = None
        self.v: G = None
        self.p: A = None
        self.q: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: C = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.u: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: B = None
        self.r: C = None
        self.w: C = None
        self.v: G = None
        self.p: A = None
        self.q: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: C = None
        self.txt = txt

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

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

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

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