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

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

class C:
    def __init__(self, txt: str):
        self.v: E = None
        self.o: D = None
        self.s: F = None
        self.txt = txt

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

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

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

d = A("d")
k = B("k")
l = C("l")
e = D("e")
j = E("j")
h = F("h")
g = F("g")
b = A("b")
n = F("n")

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

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

class C:
    def __init__(self, txt: str):
        self.v: E = None
        self.o: D = None
        self.s: F = None
        self.txt = txt

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

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

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

d = A("d")
k = B("k")
l = C("l")
e = D("e")
j = E("j")
h = F("h")
g = F("g")
b = A("b")
n = F("n")

d.q = l
d.z = l
d.t = l
d.w = j
d.x = j
k.x = j
k.y = l
k.s = g
k.u = d
k.z = b
l.v = j
l.o = e
l.s = n
e.q = g
e.p = j
e.y = l
j.y = g
j.u = n
h.t = l
h.y = j
h.w = e
g.t = l
g.y = j
g.w = e
b.q = l
b.z = l
b.t = l
b.w = j
b.x = j
n.t = l
n.y = j
n.w = e
assert d.w.y.w.q.w.q.w.q.txt == "g"