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

class B:
    def __init__(self, txt: str):
        self.u: A = None
        self.z: F = None
        self.w: A = None
        self.s: D = None
        self.o: F = None
        self.v: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: A = None
        self.t: C = None
        self.p: F = None
        self.q: C = None
        self.o: B = None
        self.s: F = None
        self.txt = txt

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

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

d = A("d")
i = B("i")
h = C("h")
k = D("k")
m = E("m")
j = F("j")
c = F("c")
g = E("g")
n = F("n")

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

class B:
    def __init__(self, txt: str):
        self.u: A = None
        self.z: F = None
        self.w: A = None
        self.s: D = None
        self.o: F = None
        self.v: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: A = None
        self.t: C = None
        self.p: F = None
        self.q: C = None
        self.o: B = None
        self.s: F = None
        self.txt = txt

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

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

d = A("d")
i = B("i")
h = C("h")
k = D("k")
m = E("m")
j = F("j")
c = F("c")
g = E("g")
n = F("n")

d.q = n
d.y = h
d.z = g
i.u = d
i.w = d
i.z = j
i.o = j
i.s = k
i.v = h
h.w = d
h.q = k
h.v = m
k.y = d
k.t = h
k.q = h
k.p = c
k.o = i
k.s = j
m.w = d
m.z = n
j.s = h
j.y = h
j.p = h
j.v = k
j.t = g
c.s = h
c.y = h
c.p = h
c.v = k
c.t = m
g.w = d
g.z = c
n.s = h
n.y = h
n.p = h
n.v = k
n.t = g
assert d.q.v.o.v.v.w.txt == "d"