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

class B:
    def __init__(self, txt: str):
        self.r: C = None
        self.t: F = None
        self.p: F = None
        self.s: H = None
        self.w: A = None
        self.o: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: D = None
        self.x: G = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.x: H = None
        self.u: D = None
        self.q: D = None
        self.t: D = None
        self.v: C = None
        self.y: E = None
        self.p: G = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.t: A = None
        self.y: C = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.r: C = None
        self.t: F = None
        self.p: F = None
        self.s: H = None
        self.w: A = None
        self.o: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: D = None
        self.x: G = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.x: H = None
        self.u: D = None
        self.q: D = None
        self.t: D = None
        self.v: C = None
        self.y: E = None
        self.p: G = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.t: A = None
        self.y: C = None
        self.txt = txt

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

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