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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.t: E = None
        self.u: E = None
        self.y: A = None
        self.txt = txt

n = A("n")
h = B("h")
j = C("j")
f = D("f")
m = E("m")
l = F("l")
g = B("g")
k = D("k")
b = A("b")

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.t: E = None
        self.u: E = None
        self.y: A = None
        self.txt = txt

n = A("n")
h = B("h")
j = C("j")
f = D("f")
m = E("m")
l = F("l")
g = B("g")
k = D("k")
b = A("b")

n.s = b
h.w = g
h.r = j
h.y = k
j.p = g
j.x = l
j.r = l
f.t = m
f.s = m
m.z = n
m.q = k
m.v = k
m.t = l
m.r = h
m.x = j
l.t = m
l.u = m
l.y = n
g.w = h
g.r = j
g.y = f
k.t = m
k.s = m
b.s = n
assert f.s.x.r.u.txt == "m"