class A:
    def __init__(self, txt: str):
        self.u: C = None
        self.t: C = None
        self.r: B = None
        self.x: C = None
        self.w: D = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.w: B = None
        self.t: F = None
        self.u: A = None
        self.txt = txt

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

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

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

d.u = f
d.t = a
d.x = a
d.r = h
d.w = c
j.y = h
j.v = a
j.t = c
j.r = c
j.w = c
a.s = h
a.x = d
a.z = j
c.w = j
c.t = m
c.u = d
b.r = n
b.x = d
m.r = d
m.z = h
m.t = i
i.r = d
i.z = h
i.t = m
n.r = b
n.x = d
h.y = j
h.v = f
h.t = c
h.r = c
h.w = c
f.s = h
f.x = d
f.z = j
assert n.x.r.w.u.x.txt == "
class A:
    def __init__(self, txt: str):
        self.u: C = None
        self.t: C = None
        self.r: B = None
        self.x: C = None
        self.w: D = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.w: B = None
        self.t: F = None
        self.u: A = None
        self.txt = txt

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

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

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

d.u = f
d.t = a
d.x = a
d.r = h
d.w = c
j.y = h
j.v = a
j.t = c
j.r = c
j.w = c
a.s = h
a.x = d
a.z = j
c.w = j
c.t = m
c.u = d
b.r = n
b.x = d
m.r = d
m.z = h
m.t = i
i.r = d
i.z = h
i.t = m
n.r = b
n.x = d
h.y = j
h.v = f
h.t = c
h.r = c
h.w = c
f.s = h
f.x = d
f.z = j
assert n.x.r.w.u.x.txt == "a"