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

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

class C:
    def __init__(self, txt: str):
        self.o: H = None
        self.x: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: A = None
        self.z: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.w: E = None
        self.v: E = None
        self.t: H = None
        self.x: I = None
        self.u: I = None
        self.p: H = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.z: C = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.o: H = None
        self.x: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: A = None
        self.z: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.w: E = None
        self.v: E = None
        self.t: H = None
        self.x: I = None
        self.u: I = None
        self.p: H = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.z: C = None
        self.txt = txt

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

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

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