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

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

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

class D:
    def __init__(self, txt: str):
        self.p: B = None
        self.s: B = None
        self.o: F = None
        self.txt = txt

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.p: B = None
        self.s: B = None
        self.o: F = None
        self.txt = txt

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

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

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

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