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

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

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

class D:
    def __init__(self, txt: str):
        self.w: F = None
        self.o: C = None
        self.x: D = None
        self.v: E = None
        self.txt = txt

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

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

c = A("c")
l = B("l")
k = C("k")
n = D("n")
h = E("h")
d = F("d")
j = C("j")
m = D("m")
i = F("i")
g = B("g")

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

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

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

class D:
    def __init__(self, txt: str):
        self.w: F = None
        self.o: C = None
        self.x: D = None
        self.v: E = None
        self.txt = txt

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

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

c = A("c")
l = B("l")
k = C("k")
n = D("n")
h = E("h")
d = F("d")
j = C("j")
m = D("m")
i = F("i")
g = B("g")

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