class A:
    def __init__(self, txt: str):
        self.v: E = None
        self.o: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.z: E = None
        self.txt = txt

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.z: E = None
        self.txt = txt

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

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

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

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

g.v = e
g.o = h
k.p = e
k.q = e
k.o = m
k.x = h
k.t = a
k.w = j
m.z = d
h.x = a
e.r = f
e.q = k
e.y = c
a.z = f
f.v = d
f.o = h
j.p = d
j.q = d
j.o = m
j.x = h
j.t = a
j.w = k
c.z = e
d.r = f
d.q = j
d.y = c
assert g.v.y.z.r.o.x.z.v.txt == "d"