class A:
    def __init__(self, txt: str):
        self.r: E = None
        self.u: F = None
        self.y: B = None
        self.x: B = None
        self.q: C = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.r: G = None
        self.w: B = None
        self.t: E = None
        self.s: F = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.q: D = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.r: G = None
        self.w: B = None
        self.t: E = None
        self.s: F = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.q: D = None
        self.txt = txt

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

n.r = d
n.u = k
n.y = h
n.x = h
n.q = i
h.p = d
i.u = b
i.o = b
a.r = b
a.w = h
a.t = d
a.s = k
d.x = i
d.t = i
d.o = i
d.z = i
d.u = i
d.y = a
k.w = i
k.p = b
b.q = a
assert n.u.w.o.txt == "b"