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

class B:
    def __init__(self, txt: str):
        self.z: F = None
        self.u: C = None
        self.q: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: B = None
        self.p: A = None
        self.w: B = None
        self.v: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: F = None
        self.p: A = None
        self.t: F = None
        self.o: E = None
        self.s: B = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.p: B = None
        self.s: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.z: F = None
        self.u: C = None
        self.q: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: B = None
        self.p: A = None
        self.w: B = None
        self.v: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: F = None
        self.p: A = None
        self.t: F = None
        self.o: E = None
        self.s: B = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.p: B = None
        self.s: B = None
        self.txt = txt

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

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