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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.t: E = None
        self.q: E = None
        self.u: E = None
        self.txt = txt

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.t: E = None
        self.q: E = None
        self.u: E = None
        self.txt = txt

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

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