class A:
    def __init__(self, txt: str):
        self.x: I = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: E = None
        self.q: C = None
        self.o: A = None
        self.w: A = None
        self.t: C = None
        self.x: H = None
        self.u: H = None
        self.s: A = None
        self.v: G = None
        self.txt = txt

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.t: G = None
        self.p: F = None
        self.x: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.x: C = None
        self.s: E = None
        self.txt = txt

d = A("d")
a = B("a")
c = C("c")
f = D("f")
b = E("b")
j = F("j")
n = G("n")
l = H("l")
e = I("e")
h = G("h")

d.x = e
a.r = b
a.q = c
a.t = c
a.o = d
a.w = d
a.s = d
a.x = l
a.u = l
a.v = h
c.p = j
f.v = d
f.w = j
f.z = b
f.s = b
f.u = a
b.x = n
j.r = n
j.s = c
j.t = b
n.s = h
n.z = e
l.t = h
l.p = j
l.x = d
e.x = c
e.s = b
h.s = n
h.z = e
assert j.s.p.r.z.x.p.txt == "
class A:
    def __init__(self, txt: str):
        self.x: I = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: E = None
        self.q: C = None
        self.o: A = None
        self.w: A = None
        self.t: C = None
        self.x: H = None
        self.u: H = None
        self.s: A = None
        self.v: G = None
        self.txt = txt

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.t: G = None
        self.p: F = None
        self.x: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.x: C = None
        self.s: E = None
        self.txt = txt

d = A("d")
a = B("a")
c = C("c")
f = D("f")
b = E("b")
j = F("j")
n = G("n")
l = H("l")
e = I("e")
h = G("h")

d.x = e
a.r = b
a.q = c
a.t = c
a.o = d
a.w = d
a.s = d
a.x = l
a.u = l
a.v = h
c.p = j
f.v = d
f.w = j
f.z = b
f.s = b
f.u = a
b.x = n
j.r = n
j.s = c
j.t = b
n.s = h
n.z = e
l.t = h
l.p = j
l.x = d
e.x = c
e.s = b
h.s = n
h.z = e
assert j.s.p.r.z.x.p.txt == "j"