class A:
    def __init__(self, txt: str):
        self.r: E = None
        self.v: F = None
        self.w: H = None
        self.y: C = None
        self.z: B = None
        self.x: F = None
        self.o: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: C = None
        self.u: H = None
        self.o: G = None
        self.r: G = None
        self.q: E = None
        self.s: G = None
        self.txt = txt

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.x: A = None
        self.p: C = None
        self.txt = txt

j = A("j")
d = B("d")
c = C("c")
e = D("e")
l = E("l")
i = F("i")
n = G("n")
k = H("k")
g = F("g")

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

class B:
    def __init__(self, txt: str):
        self.v: C = None
        self.u: H = None
        self.o: G = None
        self.r: G = None
        self.q: E = None
        self.s: G = None
        self.txt = txt

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.x: A = None
        self.p: C = None
        self.txt = txt

j = A("j")
d = B("d")
c = C("c")
e = D("e")
l = E("l")
i = F("i")
n = G("n")
k = H("k")
g = F("g")

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