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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.x: C = None
        self.z: D = None
        self.y: D = None
        self.txt = txt

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.x: C = None
        self.z: D = None
        self.y: D = None
        self.txt = txt

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

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