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

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

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

class D:
    def __init__(self, txt: str):
        self.q: C = None
        self.y: E = None
        self.z: A = None
        self.o: H = None
        self.u: B = None
        self.x: E = None
        self.txt = txt

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

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

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.q: C = None
        self.y: E = None
        self.z: A = None
        self.o: H = None
        self.u: B = None
        self.x: E = None
        self.txt = txt

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

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

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

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

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

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