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

class B:
    def __init__(self, txt: str):
        self.z: G = None
        self.s: D = None
        self.q: G = None
        self.v: C = None
        self.x: H = None
        self.o: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: A = None
        self.u: G = None
        self.w: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: H = None
        self.r: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: F = None
        self.q: A = None
        self.p: C = None
        self.txt = txt

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

c = A("c")
f = B("f")
n = C("n")
e = D("e")
a = E("a")
h = F("h")
m = G("m")
b = H("b")
k = C("k")
l = H("l")

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

class B:
    def __init__(self, txt: str):
        self.z: G = None
        self.s: D = None
        self.q: G = None
        self.v: C = None
        self.x: H = None
        self.o: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: A = None
        self.u: G = None
        self.w: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: H = None
        self.r: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: F = None
        self.q: A = None
        self.p: C = None
        self.txt = txt

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

c = A("c")
f = B("f")
n = C("n")
e = D("e")
a = E("a")
h = F("h")
m = G("m")
b = H("b")
k = C("k")
l = H("l")

c.p = f
c.r = e
c.y = n
c.q = m
c.z = b
f.z = m
f.q = m
f.s = e
f.v = n
f.x = b
f.o = c
n.v = l
n.q = e
e.y = c
e.u = m
e.w = m
a.v = m
h.w = b
h.r = e
m.y = h
m.q = c
m.p = n
b.y = n
b.z = a
b.x = a
k.v = l
k.q = e
l.y = n
l.z = a
l.x = a
assert c.y.v.y.v.txt == "l"