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

class B:
    def __init__(self, txt: str):
        self.o: D = None
        self.r: E = None
        self.p: A = None
        self.t: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: B = None
        self.t: D = None
        self.r: B = None
        self.x: F = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.q: C = None
        self.z: F = None
        self.p: C = None
        self.u: B = None
        self.v: A = None
        self.r: A = None
        self.y: C = None
        self.t: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: B = None
        self.x: E = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.o: D = None
        self.r: E = None
        self.p: A = None
        self.t: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: B = None
        self.t: D = None
        self.r: B = None
        self.x: F = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.q: C = None
        self.z: F = None
        self.p: C = None
        self.u: B = None
        self.v: A = None
        self.r: A = None
        self.y: C = None
        self.t: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: B = None
        self.x: E = None
        self.txt = txt

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

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