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

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

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

class D:
    def __init__(self, txt: str):
        self.t: E = None
        self.w: G = None
        self.x: A = None
        self.q: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: A = None
        self.u: F = None
        self.r: C = None
        self.s: G = None
        self.t: F = None
        self.p: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.t: A = None
        self.w: C = None
        self.o: F = None
        self.r: E = None
        self.z: F = None
        self.txt = txt

k = A("k")
e = B("e")
n = C("n")
h = D("h")
f = E("f")
b = F("b")
d = G("d")
j = F("j")
m = A("m")

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

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

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

class D:
    def __init__(self, txt: str):
        self.t: E = None
        self.w: G = None
        self.x: A = None
        self.q: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: A = None
        self.u: F = None
        self.r: C = None
        self.s: G = None
        self.t: F = None
        self.p: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.t: A = None
        self.w: C = None
        self.o: F = None
        self.r: E = None
        self.z: F = None
        self.txt = txt

k = A("k")
e = B("e")
n = C("n")
h = D("h")
f = E("f")
b = F("b")
d = G("d")
j = F("j")
m = A("m")

k.y = f
k.x = m
k.t = e
e.p = j
n.s = m
h.t = f
h.w = d
h.x = m
h.q = b
f.z = m
f.u = b
f.r = n
f.s = d
f.t = j
f.p = e
b.w = d
b.y = h
d.t = k
d.w = n
d.o = j
d.z = j
d.r = f
j.w = d
j.y = h
m.y = f
m.x = k
m.t = e
assert d.r.s.t.x.x.x.y.t.txt == "j"