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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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