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

class B:
    def __init__(self, txt: str):
        self.y: F = None
        self.u: F = None
        self.v: B = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.p: D = None
        self.v: E = None
        self.x: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: D = None
        self.r: A = None
        self.y: F = None
        self.p: D = None
        self.txt = txt

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

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

b.z = c
b.t = n
d.y = g
d.u = g
d.v = j
h.y = g
h.o = e
h.w = f
h.x = a
c.p = n
c.v = a
c.x = d
a.o = n
a.r = b
a.y = g
a.p = c
g.w = f
j.y = g
j.u = g
j.v = f
n.p = c
n.v = a
n.x = j
f.y = g
f.u = g
f.v = d
e.y = g
e.o = h
e.w = j
e.x = a
assert n.x.u.w.v.txt == "
class A:
    def __init__(self, txt: str):
        self.z: D = None
        self.t: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: F = None
        self.u: F = None
        self.v: B = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.p: D = None
        self.v: E = None
        self.x: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: D = None
        self.r: A = None
        self.y: F = None
        self.p: D = None
        self.txt = txt

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

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

b.z = c
b.t = n
d.y = g
d.u = g
d.v = j
h.y = g
h.o = e
h.w = f
h.x = a
c.p = n
c.v = a
c.x = d
a.o = n
a.r = b
a.y = g
a.p = c
g.w = f
j.y = g
j.u = g
j.v = f
n.p = c
n.v = a
n.x = j
f.y = g
f.u = g
f.v = d
e.y = g
e.o = h
e.w = j
e.x = a
assert n.x.u.w.v.txt == "d"