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

class B:
    def __init__(self, txt: str):
        self.y: D = None
        self.q: F = None
        self.u: F = None
        self.txt = txt

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

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

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

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

n = A("n")
a = B("a")
c = C("c")
i = D("i")
g = E("g")
l = F("l")
j = B("j")

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

class B:
    def __init__(self, txt: str):
        self.y: D = None
        self.q: F = None
        self.u: F = None
        self.txt = txt

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

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

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

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

n = A("n")
a = B("a")
c = C("c")
i = D("i")
g = E("g")
l = F("l")
j = B("j")

n.t = c
a.y = i
a.q = l
a.u = l
c.o = g
c.w = g
i.y = g
i.v = a
i.p = c
g.z = a
g.x = n
g.s = n
g.v = c
g.p = c
g.r = i
l.r = j
l.s = j
j.y = i
j.q = l
j.u = l
assert j.y.v.u.r.q.r.txt == "j"