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

class B:
    def __init__(self, txt: str):
        self.u: A = None
        self.s: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: D = None
        self.y: A = None
        self.u: A = None
        self.r: C = None
        self.q: A = None
        self.o: G = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.q: D = None
        self.y: D = None
        self.s: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.u: A = None
        self.s: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: D = None
        self.y: A = None
        self.u: A = None
        self.r: C = None
        self.q: A = None
        self.o: G = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.q: D = None
        self.y: D = None
        self.s: A = None
        self.txt = txt

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

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