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

class B:
    def __init__(self, txt: str):
        self.s: D = None
        self.v: G = None
        self.t: E = None
        self.x: C = None
        self.r: E = None
        self.z: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: A = None
        self.y: D = None
        self.r: A = None
        self.t: E = None
        self.x: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: C = None
        self.v: B = None
        self.w: E = None
        self.r: G = None
        self.p: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: A = None
        self.v: A = None
        self.p: C = None
        self.r: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: G = None
        self.txt = txt

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

f = A("f")
h = B("h")
e = C("e")
b = D("b")
n = E("n")
k = F("k")
i = G("i")
m = G("m")

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

class B:
    def __init__(self, txt: str):
        self.s: D = None
        self.v: G = None
        self.t: E = None
        self.x: C = None
        self.r: E = None
        self.z: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: A = None
        self.y: D = None
        self.r: A = None
        self.t: E = None
        self.x: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: C = None
        self.v: B = None
        self.w: E = None
        self.r: G = None
        self.p: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: A = None
        self.v: A = None
        self.p: C = None
        self.r: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: G = None
        self.txt = txt

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

f = A("f")
h = B("h")
e = C("e")
b = D("b")
n = E("n")
k = F("k")
i = G("i")
m = G("m")

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