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

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

class C:
    def __init__(self, txt: str):
        self.y: H = None
        self.z: D = None
        self.x: B = None
        self.s: F = None
        self.w: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: C = None
        self.w: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: C = None
        self.p: B = None
        self.u: C = None
        self.q: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.y: H = None
        self.u: F = None
        self.z: H = None
        self.s: B = None
        self.t: A = None
        self.r: H = None
        self.txt = txt

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

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

c.y = d
c.w = l
c.o = g
c.z = b
l.o = k
l.y = k
l.x = m
l.p = b
l.r = c
g.y = d
g.z = b
g.x = l
g.s = k
g.w = c
b.p = g
b.w = l
m.w = g
m.u = g
m.p = l
m.q = c
k.u = c
k.v = l
k.p = l
k.o = l
k.y = b
k.t = m
k.r = g
n.y = d
n.z = d
n.r = d
n.u = k
n.s = l
n.t = c
d.z = l
d.r = l
assert d.z.p.p.y.r.x.txt == "
class A:
    def __init__(self, txt: str):
        self.y: H = None
        self.w: B = None
        self.o: C = None
        self.z: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: H = None
        self.z: D = None
        self.x: B = None
        self.s: F = None
        self.w: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: C = None
        self.w: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: C = None
        self.p: B = None
        self.u: C = None
        self.q: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.y: H = None
        self.u: F = None
        self.z: H = None
        self.s: B = None
        self.t: A = None
        self.r: H = None
        self.txt = txt

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

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

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