class A:
    def __init__(self, txt: str):
        self.y: B = None
        self.w: B = None
        self.q: F = None
        self.t: A = None
        self.txt = txt

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

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

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

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

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

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

f.y = c
f.w = k
f.q = e
f.t = b
j.y = i
j.t = i
j.w = f
i.w = h
g.z = f
g.q = f
g.v = h
g.o = i
g.u = j
h.r = j
h.o = k
h.v = e
e.t = b
e.v = c
e.r = k
e.s = k
e.x = h
e.w = i
c.y = i
c.t = i
c.w = f
k.y = i
k.t = i
k.w = f
b.y = k
b.w = c
b.q = e
b.t = f
l.z = f
l.q = f
l.v = h
l.o = i
l.u = c
assert b.q.s.w.q.w.w.r.w.q.t.txt == "
class A:
    def __init__(self, txt: str):
        self.y: B = None
        self.w: B = None
        self.q: F = None
        self.t: A = None
        self.txt = txt

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

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

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

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

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

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

f.y = c
f.w = k
f.q = e
f.t = b
j.y = i
j.t = i
j.w = f
i.w = h
g.z = f
g.q = f
g.v = h
g.o = i
g.u = j
h.r = j
h.o = k
h.v = e
e.t = b
e.v = c
e.r = k
e.s = k
e.x = h
e.w = i
c.y = i
c.t = i
c.w = f
k.y = i
k.t = i
k.w = f
b.y = k
b.w = c
b.q = e
b.t = f
l.z = f
l.q = f
l.v = h
l.o = i
l.u = c
assert b.q.s.w.q.w.w.r.w.q.t.txt == "b"