class A:
    def __init__(self, txt: str):
        self.s: C = None
        self.y: C = None
        self.r: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: C = None
        self.r: F = None
        self.t: C = None
        self.p: A = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.s: D = None
        self.txt = txt

c = A("c")
j = B("j")
l = C("l")
a = D("a")
n = E("n")
m = F("m")
b = D("b")
h = F("h")

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

class B:
    def __init__(self, txt: str):
        self.y: C = None
        self.r: F = None
        self.t: C = None
        self.p: A = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.s: D = None
        self.txt = txt

c = A("c")
j = B("j")
l = C("l")
a = D("a")
n = E("n")
m = F("m")
b = D("b")
h = F("h")

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