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

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

class C:
    def __init__(self, txt: str):
        self.r: A = None
        self.u: F = None
        self.w: E = None
        self.z: E = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.v: G = None
        self.p: C = None
        self.t: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: B = None
        self.p: E = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.r: A = None
        self.u: F = None
        self.w: E = None
        self.z: E = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.v: G = None
        self.p: C = None
        self.t: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: B = None
        self.p: E = None
        self.txt = txt

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

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