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

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

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

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

class E:
    def __init__(self, txt: str):
        self.x: F = None
        self.w: A = None
        self.z: D = None
        self.p: D = None
        self.t: C = None
        self.u: A = None
        self.txt = txt

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

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

m.t = h
m.v = f
m.w = c
n.q = g
n.r = h
n.v = i
i.y = h
i.p = a
i.v = a
i.r = a
i.u = c
c.p = g
c.x = h
a.x = h
a.w = m
a.u = m
a.z = c
a.p = c
a.t = f
h.v = m
f.y = h
f.p = a
f.v = a
f.r = a
f.u = c
g.q = n
g.r = h
g.v = f
assert a.u.w.x.v.t.v.v.y.txt == "
class A:
    def __init__(self, txt: str):
        self.t: F = None
        self.v: C = None
        self.w: D = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.x: F = None
        self.w: A = None
        self.z: D = None
        self.p: D = None
        self.t: C = None
        self.u: A = None
        self.txt = txt

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

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

m.t = h
m.v = f
m.w = c
n.q = g
n.r = h
n.v = i
i.y = h
i.p = a
i.v = a
i.r = a
i.u = c
c.p = g
c.x = h
a.x = h
a.w = m
a.u = m
a.z = c
a.p = c
a.t = f
h.v = m
f.y = h
f.p = a
f.v = a
f.r = a
f.u = c
g.q = n
g.r = h
g.v = f
assert a.u.w.x.v.t.v.v.y.txt == "h"