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

class B:
    def __init__(self, txt: str):
        self.w: E = None
        self.o: D = None
        self.x: F = None
        self.t: C = None
        self.s: D = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.t: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: H = None
        self.r: F = None
        self.t: F = None
        self.u: B = None
        self.o: E = None
        self.txt = txt

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

e = A("e")
m = B("m")
c = C("c")
j = D("j")
f = E("f")
n = F("n")
h = G("h")
i = H("i")
d = H("d")

e.w = m
e.u = m
e.r = f
m.w = f
m.o = j
m.s = j
m.x = n
m.t = c
c.p = j
c.q = j
c.o = i
j.u = c
f.z = c
n.t = m
h.p = i
h.r = n
h.t = n
h.u = m
h.o = f
i.q = f
i.o = j
d.q = f
d.o = j
assert m.w.z.p.txt == "
class A:
    def __init__(self, txt: str):
        self.w: B = None
        self.u: B = None
        self.r: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: E = None
        self.o: D = None
        self.x: F = None
        self.t: C = None
        self.s: D = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.t: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: H = None
        self.r: F = None
        self.t: F = None
        self.u: B = None
        self.o: E = None
        self.txt = txt

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

e = A("e")
m = B("m")
c = C("c")
j = D("j")
f = E("f")
n = F("n")
h = G("h")
i = H("i")
d = H("d")

e.w = m
e.u = m
e.r = f
m.w = f
m.o = j
m.s = j
m.x = n
m.t = c
c.p = j
c.q = j
c.o = i
j.u = c
f.z = c
n.t = m
h.p = i
h.r = n
h.t = n
h.u = m
h.o = f
i.q = f
i.o = j
d.q = f
d.o = j
assert m.w.z.p.txt == "j"