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

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

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

m = A("m")
h = B("h")
c = C("c")
f = C("f")
k = A("k")
i = C("i")
g = B("g")
l = B("l")
e = C("e")
j = B("j")

m.t = h
m.p = g
m.x = g
h.y = c
c.p = f
c.q = g
c.y = j
f.p = i
f.q = g
f.y = h
k.t = l
k.p = l
k.x = g
i.p = c
i.q = j
i.y = l
g.y = i
l.y = i
e.p = i
e.q = l
e.y = h
j.y = c
assert f.q.y.y.txt == "
class A:
    def __init__(self, txt: str):
        self.t: B = None
        self.p: B = None
        self.x: B = None
        self.txt = txt

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

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

m = A("m")
h = B("h")
c = C("c")
f = C("f")
k = A("k")
i = C("i")
g = B("g")
l = B("l")
e = C("e")
j = B("j")

m.t = h
m.p = g
m.x = g
h.y = c
c.p = f
c.q = g
c.y = j
f.p = i
f.q = g
f.y = h
k.t = l
k.p = l
k.x = g
i.p = c
i.q = j
i.y = l
g.y = i
l.y = i
e.p = i
e.q = l
e.y = h
j.y = c
assert f.q.y.y.txt == "l"