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

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

class C:
    def __init__(self, txt: str):
        self.w: A = None
        self.z: F = None
        self.t: F = None
        self.o: E = None
        self.s: A = None
        self.p: B = None
        self.txt = txt

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.w: A = None
        self.z: F = None
        self.t: F = None
        self.o: E = None
        self.s: A = None
        self.p: B = None
        self.txt = txt

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

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

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

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

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