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

class B:
    def __init__(self, txt: str):
        self.y: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.z: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.t: B = None
        self.o: E = None
        self.y: E = None
        self.v: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: C = None
        self.v: E = None
        self.w: F = None
        self.o: F = None
        self.r: H = None
        self.p: D = None
        self.u: D = None
        self.txt = txt

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

j = A("j")
g = B("g")
n = C("n")
c = D("c")
l = E("l")
f = F("f")
d = G("d")
k = H("k")

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

class B:
    def __init__(self, txt: str):
        self.y: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.z: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.t: B = None
        self.o: E = None
        self.y: E = None
        self.v: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: C = None
        self.v: E = None
        self.w: F = None
        self.o: F = None
        self.r: H = None
        self.p: D = None
        self.u: D = None
        self.txt = txt

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

j = A("j")
g = B("g")
n = C("n")
c = D("c")
l = E("l")
f = F("f")
d = G("d")
k = H("k")

j.r = f
g.y = n
n.t = d
n.v = j
c.z = g
l.t = d
l.r = g
f.t = g
f.o = l
f.y = l
f.v = n
d.y = n
d.v = l
d.w = f
d.o = f
d.r = k
d.p = c
d.u = c
k.x = d
assert n.t.p.z.y.txt == "n"