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

class B:
    def __init__(self, txt: str):
        self.r: E = None
        self.v: G = None
        self.z: A = None
        self.w: C = None
        self.s: D = None
        self.y: E = None
        self.x: G = 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.z: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: E = None
        self.v: C = None
        self.q: D = None
        self.x: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: A = None
        self.z: D = None
        self.txt = txt

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

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

j.p = h
j.w = i
j.u = i
f.r = m
f.v = k
f.x = k
f.z = j
f.w = c
f.s = d
f.y = l
c.u = h
d.z = h
m.y = l
m.v = c
m.q = d
m.x = h
h.r = i
h.z = d
k.x = c
k.w = i
n.r = l
n.v = k
n.x = k
n.z = i
n.w = c
n.s = d
n.y = m
i.p = h
i.w = j
i.u = j
l.y = m
l.v = c
l.q = d
l.x = h
assert l.y.q.z.txt == "
class A:
    def __init__(self, txt: str):
        self.p: F = None
        self.w: A = None
        self.u: A = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: E = None
        self.v: G = None
        self.z: A = None
        self.w: C = None
        self.s: D = None
        self.y: E = None
        self.x: G = 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.z: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: E = None
        self.v: C = None
        self.q: D = None
        self.x: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: A = None
        self.z: D = None
        self.txt = txt

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

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

j.p = h
j.w = i
j.u = i
f.r = m
f.v = k
f.x = k
f.z = j
f.w = c
f.s = d
f.y = l
c.u = h
d.z = h
m.y = l
m.v = c
m.q = d
m.x = h
h.r = i
h.z = d
k.x = c
k.w = i
n.r = l
n.v = k
n.x = k
n.z = i
n.w = c
n.s = d
n.y = m
i.p = h
i.w = j
i.u = j
l.y = m
l.v = c
l.q = d
l.x = h
assert l.y.q.z.txt == "h"