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

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

class C:
    def __init__(self, txt: str):
        self.u: D = None
        self.v: G = None
        self.t: E = None
        self.o: D = None
        self.y: E = None
        self.q: A = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.o: A = None
        self.z: E = None
        self.v: B = None
        self.q: H = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.u: D = None
        self.v: G = None
        self.t: E = None
        self.o: D = None
        self.y: E = None
        self.q: A = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.o: A = None
        self.z: E = None
        self.v: B = None
        self.q: H = None
        self.txt = txt

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

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

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

n.x = d
h.t = i
h.v = i
h.u = n
m.u = d
m.o = d
m.v = j
m.t = i
m.y = i
m.q = n
d.p = i
i.u = h
i.t = m
i.w = m
i.y = d
g.o = n
g.z = i
g.v = h
g.q = b
j.p = m
j.x = n
j.o = g
b.r = m
b.x = m
b.t = j
assert j.p.o.p.y.p.txt == "i"