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

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

class C:
    def __init__(self, txt: str):
        self.o: F = None
        self.r: E = None
        self.y: B = None
        self.v: D = None
        self.s: D = None
        self.txt = txt

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.o: F = None
        self.r: E = None
        self.y: B = None
        self.v: D = None
        self.s: D = None
        self.txt = txt

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

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

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

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

e.z = c
e.r = j
j.q = f
j.u = c
j.x = k
c.o = f
c.r = n
c.y = j
c.v = g
c.s = g
g.w = j
g.v = k
n.r = k
l.u = j
l.x = e
l.v = c
l.z = g
l.s = n
k.o = f
k.r = n
k.y = j
k.v = g
k.s = g
f.u = j
f.x = e
f.v = k
f.z = g
f.s = n
assert e.r.x.v.txt == "g"