class A:
    def __init__(self, txt: str):
        self.z: C = None
        self.s: D = None
        self.q: C = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.u: B = None
        self.v: E = None
        self.p: A = None
        self.z: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: C = None
        self.z: B = None
        self.o: A = None
        self.u: A = None
        self.txt = txt

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.u: B = None
        self.v: E = None
        self.p: A = None
        self.z: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: C = None
        self.z: B = None
        self.o: A = None
        self.u: A = None
        self.txt = txt

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

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

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