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

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

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

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

class E:
    def __init__(self, txt: str):
        self.o: H = None
        self.z: G = None
        self.r: H = None
        self.x: D = None
        self.y: D = None
        self.s: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.p: B = None
        self.o: D = None
        self.y: H = None
        self.s: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: G = None
        self.z: E = None
        self.p: E = None
        self.q: C = None
        self.o: B = None
        self.t: E = None
        self.u: G = None
        self.v: G = None
        self.txt = txt

e = A("e")
j = B("j")
c = C("c")
b = D("b")
m = E("m")
i = F("i")
f = G("f")
g = H("g")

e.y = c
e.w = m
j.u = f
j.y = f
c.z = e
c.o = j
b.p = c
m.o = g
m.r = g
m.z = f
m.x = b
m.y = b
m.s = c
i.p = e
f.p = j
f.o = b
f.y = g
f.s = m
g.x = f
g.u = f
g.v = f
g.z = m
g.p = m
g.t = m
g.q = c
g.o = j
assert b.p.o.u.p.txt == "
class A:
    def __init__(self, txt: str):
        self.y: C = None
        self.w: E = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.o: H = None
        self.z: G = None
        self.r: H = None
        self.x: D = None
        self.y: D = None
        self.s: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.p: B = None
        self.o: D = None
        self.y: H = None
        self.s: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: G = None
        self.z: E = None
        self.p: E = None
        self.q: C = None
        self.o: B = None
        self.t: E = None
        self.u: G = None
        self.v: G = None
        self.txt = txt

e = A("e")
j = B("j")
c = C("c")
b = D("b")
m = E("m")
i = F("i")
f = G("f")
g = H("g")

e.y = c
e.w = m
j.u = f
j.y = f
c.z = e
c.o = j
b.p = c
m.o = g
m.r = g
m.z = f
m.x = b
m.y = b
m.s = c
i.p = e
f.p = j
f.o = b
f.y = g
f.s = m
g.x = f
g.u = f
g.v = f
g.z = m
g.p = m
g.t = m
g.q = c
g.o = j
assert b.p.o.u.p.txt == "j"