class A:
    def __init__(self, txt: str):
        self.r: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: C = None
        self.v: F = None
        self.z: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.q: D = None
        self.r: F = None
        self.z: A = None
        self.t: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: B = None
        self.q: C = None
        self.v: C = None
        self.txt = txt

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

g.r = i
c.q = l
c.v = a
c.z = k
l.o = i
l.y = i
l.z = c
k.q = n
k.r = m
k.z = g
k.t = i
i.z = g
f.w = c
f.q = j
f.v = j
a.w = c
a.q = l
a.v = j
j.o = i
j.y = i
j.z = c
n.q = k
n.r = m
n.z = g
n.t = i
m.w = c
m.q = j
m.v = j
assert g.r.z.r.z.r.z.r.z.txt == "
class A:
    def __init__(self, txt: str):
        self.r: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: C = None
        self.v: F = None
        self.z: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.q: D = None
        self.r: F = None
        self.z: A = None
        self.t: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: B = None
        self.q: C = None
        self.v: C = None
        self.txt = txt

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

g.r = i
c.q = l
c.v = a
c.z = k
l.o = i
l.y = i
l.z = c
k.q = n
k.r = m
k.z = g
k.t = i
i.z = g
f.w = c
f.q = j
f.v = j
a.w = c
a.q = l
a.v = j
j.o = i
j.y = i
j.z = c
n.q = k
n.r = m
n.z = g
n.t = i
m.w = c
m.q = j
m.v = j
assert g.r.z.r.z.r.z.r.z.txt == "g"