class A:
    def __init__(self, txt: str):
        self.y: E = None
        self.r: C = None
        self.x: C = None
        self.p: E = None
        self.txt = txt

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

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

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

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

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

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

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

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

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

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

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

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

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

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