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

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

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

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

class E:
    def __init__(self, txt: str):
        self.t: C = None
        self.q: F = None
        self.z: F = None
        self.x: B = None
        self.r: G = None
        self.txt = txt

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

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

a = A("a")
n = B("n")
g = C("g")
h = D("h")
j = E("j")
c = F("c")
l = G("l")
i = B("i")

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.t: C = None
        self.q: F = None
        self.z: F = None
        self.x: B = None
        self.r: G = None
        self.txt = txt

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

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

a = A("a")
n = B("n")
g = C("g")
h = D("h")
j = E("j")
c = F("c")
l = G("l")
i = B("i")

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