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

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

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

e = A("e")
g = B("g")
h = C("h")
n = A("n")
j = C("j")
l = B("l")

e.q = j
e.p = g
g.t = e
g.u = h
g.w = j
h.y = g
h.x = g
h.u = e
n.q = h
n.p = g
j.y = l
j.u = e
j.x = g
l.t = e
l.u = h
l.w = j
assert e.q.u.p.txt == "
class A:
    def __init__(self, txt: str):
        self.q: C = None
        self.p: B = None
        self.txt = txt

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

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

e = A("e")
g = B("g")
h = C("h")
n = A("n")
j = C("j")
l = B("l")

e.q = j
e.p = g
g.t = e
g.u = h
g.w = j
h.y = g
h.x = g
h.u = e
n.q = h
n.p = g
j.y = l
j.u = e
j.x = g
l.t = e
l.u = h
l.w = j
assert e.q.u.p.txt == "g"