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

class B:
    def __init__(self, txt: str):
        self.y: E = None
        self.s: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: D = None
        self.p: B = None
        self.w: B = None
        self.o: D = None
        self.txt = txt

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

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

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

h = A("h")
e = B("e")
b = C("b")
i = D("i")
c = E("c")
l = F("l")
j = F("j")
d = E("d")

h.z = l
h.q = i
h.w = i
h.p = j
e.y = d
e.s = i
b.u = i
b.o = i
b.p = e
b.w = e
i.w = c
i.q = l
i.u = e
i.x = b
c.q = d
c.x = h
c.w = h
l.s = c
l.v = c
l.z = h
l.x = i
j.s = d
j.z = h
j.x = i
j.v = c
d.q = c
d.x = h
d.w = h
assert d.x.z.z.w.u.y.q.q.txt == "
class A:
    def __init__(self, txt: str):
        self.z: F = None
        self.q: D = None
        self.p: F = None
        self.w: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: E = None
        self.s: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: D = None
        self.p: B = None
        self.w: B = None
        self.o: D = None
        self.txt = txt

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

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

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

h = A("h")
e = B("e")
b = C("b")
i = D("i")
c = E("c")
l = F("l")
j = F("j")
d = E("d")

h.z = l
h.q = i
h.w = i
h.p = j
e.y = d
e.s = i
b.u = i
b.o = i
b.p = e
b.w = e
i.w = c
i.q = l
i.u = e
i.x = b
c.q = d
c.x = h
c.w = h
l.s = c
l.v = c
l.z = h
l.x = i
j.s = d
j.z = h
j.x = i
j.v = c
d.q = c
d.x = h
d.w = h
assert d.x.z.z.w.u.y.q.q.txt == "d"