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

class B:
    def __init__(self, txt: str):
        self.r: A = None
        self.s: A = None
        self.w: A = None
        self.z: E = None
        self.o: D = None
        self.txt = txt

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.r: A = None
        self.s: A = None
        self.w: A = None
        self.z: E = None
        self.o: D = None
        self.txt = txt

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

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

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

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

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

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