class A:
    def __init__(self, txt: str):
        self.r: G = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.v: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: H = None
        self.y: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: F = None
        self.t: G = None
        self.z: F = None
        self.u: B = None
        self.p: H = None
        self.r: A = None
        self.q: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.r: B = None
        self.o: A = None
        self.v: H = None
        self.s: A = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.v: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: H = None
        self.y: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: F = None
        self.t: G = None
        self.z: F = None
        self.u: B = None
        self.p: H = None
        self.r: A = None
        self.q: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.r: B = None
        self.o: A = None
        self.v: H = None
        self.s: A = None
        self.txt = txt

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

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

n.r = k
d.x = e
d.q = e
d.o = a
d.p = n
d.u = n
d.r = b
a.v = m
j.x = b
j.y = b
m.o = e
m.z = e
m.t = k
m.u = d
m.q = d
m.p = b
m.r = n
e.q = m
e.y = j
k.r = d
k.o = n
k.s = n
k.v = b
b.s = e
b.v = k
assert j.y.s.y.txt == "j"