class A:
    def __init__(self, txt: str):
        self.r: D = None
        self.u: C = None
        self.z: H = None
        self.p: H = None
        self.s: C = None
        self.t: G = None
        self.w: C = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.x: F = None
        self.p: G = None
        self.z: B = None
        self.v: E = None
        self.q: E = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.u: C = None
        self.y: D = None
        self.z: A = None
        self.o: A = None
        self.r: D = None
        self.p: A = None
        self.txt = txt

g = A("g")
j = B("j")
h = C("h")
f = D("f")
k = E("k")
e = F("e")
b = G("b")
l = H("l")
i = C("i")
d = E("d")

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

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

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

class D:
    def __init__(self, txt: str):
        self.x: F = None
        self.p: G = None
        self.z: B = None
        self.v: E = None
        self.q: E = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.u: C = None
        self.y: D = None
        self.z: A = None
        self.o: A = None
        self.r: D = None
        self.p: A = None
        self.txt = txt

g = A("g")
j = B("j")
h = C("h")
f = D("f")
k = E("k")
e = F("e")
b = G("b")
l = H("l")
i = C("i")
d = E("d")

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