class A:
    def __init__(self, txt: str):
        self.p: B = None
        self.u: C = None
        self.w: C = None
        self.s: D = None
        self.y: E = None
        self.v: C = None
        self.q: F = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.o: D = None
        self.x: G = None
        self.q: E = None
        self.w: A = None
        self.z: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.o: C = None
        self.txt = txt

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

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

b.p = m
b.u = k
b.w = k
b.v = k
b.s = d
b.y = n
b.q = f
m.u = f
k.w = i
k.p = m
j.o = d
j.x = a
j.q = n
j.w = b
j.z = b
i.u = a
i.y = m
i.p = b
f.o = k
a.z = k
n.u = a
n.y = m
n.p = b
d.o = j
d.x = a
d.q = i
d.w = b
d.z = b
assert d.q.u.z.w.u.txt == "
class A:
    def __init__(self, txt: str):
        self.p: B = None
        self.u: C = None
        self.w: C = None
        self.s: D = None
        self.y: E = None
        self.v: C = None
        self.q: F = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.o: D = None
        self.x: G = None
        self.q: E = None
        self.w: A = None
        self.z: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.o: C = None
        self.txt = txt

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

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

b.p = m
b.u = k
b.w = k
b.v = k
b.s = d
b.y = n
b.q = f
m.u = f
k.w = i
k.p = m
j.o = d
j.x = a
j.q = n
j.w = b
j.z = b
i.u = a
i.y = m
i.p = b
f.o = k
a.z = k
n.u = a
n.y = m
n.p = b
d.o = j
d.x = a
d.q = i
d.w = b
d.z = b
assert d.q.u.z.w.u.txt == "a"