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

class B:
    def __init__(self, txt: str):
        self.t: E = None
        self.z: D = None
        self.s: E = None
        self.u: A = None
        self.r: A = None
        self.x: F = None
        self.txt = txt

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

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

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

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

d = A("d")
m = B("m")
e = C("e")
h = D("h")
l = E("l")
n = F("n")
c = A("c")
g = E("g")
b = F("b")

d.w = n
d.v = l
d.r = b
m.t = g
m.s = g
m.z = h
m.u = d
m.r = c
m.x = b
e.v = m
e.p = m
h.q = c
h.w = b
h.u = d
h.z = e
h.p = e
l.z = c
l.s = n
l.r = d
n.w = b
n.z = e
c.w = b
c.r = b
c.v = g
g.z = d
g.s = n
g.r = c
b.w = n
b.z = e
assert g.r.v.z.r.w.z.p.u.txt == "
class A:
    def __init__(self, txt: str):
        self.w: F = None
        self.v: E = None
        self.r: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: E = None
        self.z: D = None
        self.s: E = None
        self.u: A = None
        self.r: A = None
        self.x: F = None
        self.txt = txt

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

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

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

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

d = A("d")
m = B("m")
e = C("e")
h = D("h")
l = E("l")
n = F("n")
c = A("c")
g = E("g")
b = F("b")

d.w = n
d.v = l
d.r = b
m.t = g
m.s = g
m.z = h
m.u = d
m.r = c
m.x = b
e.v = m
e.p = m
h.q = c
h.w = b
h.u = d
h.z = e
h.p = e
l.z = c
l.s = n
l.r = d
n.w = b
n.z = e
c.w = b
c.r = b
c.v = g
g.z = d
g.s = n
g.r = c
b.w = n
b.z = e
assert g.r.v.z.r.w.z.p.u.txt == "d"