class A:
    def __init__(self, txt: str):
        self.x: E = None
        self.z: E = None
        self.p: F = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.o: G = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.y: A = None
        self.z: A = None
        self.v: D = None
        self.x: A = None
        self.o: F = None
        self.s: G = None
        self.u: F = None
        self.t: D = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.o: G = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.y: A = None
        self.z: A = None
        self.v: D = None
        self.x: A = None
        self.o: F = None
        self.s: G = None
        self.u: F = None
        self.t: D = None
        self.txt = txt

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

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