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

class B:
    def __init__(self, txt: str):
        self.w: F = None
        self.v: C = None
        self.x: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: E = None
        self.s: F = None
        self.r: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: F = None
        self.q: A = None
        self.o: F = None
        self.txt = txt

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

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

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

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

d.u = c
d.x = m
d.s = g
g.w = c
g.v = a
g.x = j
a.v = m
a.s = c
a.r = j
n.z = g
n.v = c
n.y = j
m.r = c
m.o = c
m.q = d
c.p = j
c.w = d
c.q = k
k.v = n
k.p = j
j.o = d
j.y = k
assert c.p.y.v.v.txt == "
class A:
    def __init__(self, txt: str):
        self.u: F = None
        self.x: E = None
        self.s: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: F = None
        self.v: C = None
        self.x: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: E = None
        self.s: F = None
        self.r: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: F = None
        self.q: A = None
        self.o: F = None
        self.txt = txt

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

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

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

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

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