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

class B:
    def __init__(self, txt: str):
        self.y: B = None
        self.x: A = None
        self.r: E = None
        self.p: E = None
        self.s: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.p: C = None
        self.z: A = None
        self.s: A = None
        self.y: F = None
        self.o: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.t: D = None
        self.p: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: B = None
        self.p: E = None
        self.s: B = None
        self.txt = txt

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

f.t = a
f.o = k
h.y = j
h.x = f
h.r = l
h.p = l
h.s = l
k.w = g
k.s = g
k.v = g
k.r = j
k.y = a
k.t = i
k.p = l
g.p = k
g.z = f
g.s = f
g.o = f
g.y = i
l.w = k
i.t = g
i.p = a
a.q = j
a.s = j
a.p = l
j.y = h
j.x = f
j.r = l
j.p = l
j.s = l
assert a.s.x.o.s.txt == "
class A:
    def __init__(self, txt: str):
        self.t: G = None
        self.o: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: B = None
        self.x: A = None
        self.r: E = None
        self.p: E = None
        self.s: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.p: C = None
        self.z: A = None
        self.s: A = None
        self.y: F = None
        self.o: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.t: D = None
        self.p: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: B = None
        self.p: E = None
        self.s: B = None
        self.txt = txt

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

f.t = a
f.o = k
h.y = j
h.x = f
h.r = l
h.p = l
h.s = l
k.w = g
k.s = g
k.v = g
k.r = j
k.y = a
k.t = i
k.p = l
g.p = k
g.z = f
g.s = f
g.o = f
g.y = i
l.w = k
i.t = g
i.p = a
a.q = j
a.s = j
a.p = l
j.y = h
j.x = f
j.r = l
j.p = l
j.s = l
assert a.s.x.o.s.txt == "g"