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

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

class C:
    def __init__(self, txt: str):
        self.r: E = None
        self.t: F = None
        self.o: B = None
        self.p: F = None
        self.v: B = None
        self.s: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: A = None
        self.p: E = None
        self.y: A = None
        self.z: F = None
        self.v: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.r: A = None
        self.p: C = None
        self.y: C = None
        self.v: E = None
        self.x: E = None
        self.txt = txt

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

d.x = j
d.p = a
d.v = b
m.t = b
m.y = b
m.x = b
m.r = a
m.z = i
m.p = d
b.r = a
b.t = k
b.o = m
b.v = m
b.p = j
b.s = n
n.s = d
n.y = d
n.p = a
n.v = a
n.z = k
a.u = n
a.w = f
j.r = d
j.p = b
j.y = b
j.v = a
j.x = a
f.u = n
f.w = a
k.r = d
k.p = b
k.y = b
k.v = f
k.x = a
i.t = b
i.y = b
i.x = b
i.r = a
i.z = m
i.p = d
assert i.t.r.u.y.p.w.u.z.x.txt == "
class A:
    def __init__(self, txt: str):
        self.x: F = None
        self.p: E = None
        self.v: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.r: E = None
        self.t: F = None
        self.o: B = None
        self.p: F = None
        self.v: B = None
        self.s: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: A = None
        self.p: E = None
        self.y: A = None
        self.z: F = None
        self.v: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.r: A = None
        self.p: C = None
        self.y: C = None
        self.v: E = None
        self.x: E = None
        self.txt = txt

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

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