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

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

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

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

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

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

d = A("d")
m = B("m")
i = C("i")
c = D("c")
n = E("n")
b = F("b")
a = B("a")
e = D("e")
f = B("f")
g = A("g")

d.q = g
d.x = g
m.t = n
m.s = f
m.v = b
m.y = a
m.x = i
i.t = d
i.v = a
i.r = c
c.u = i
c.x = m
c.q = a
c.t = a
c.y = e
n.p = b
b.y = c
b.s = c
b.t = c
b.r = i
b.o = d
b.u = g
a.t = n
a.s = f
a.y = f
a.v = b
a.x = i
e.u = i
e.x = m
e.q = a
e.y = c
e.t = f
f.t = n
f.s = m
f.v = b
f.y = a
f.x = i
g.q = d
g.x = d
assert c.y.q.v.r.t.q.q.q.x.txt == "
class A:
    def __init__(self, txt: str):
        self.q: A = None
        self.x: A = None
        self.txt = txt

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

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

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

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

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

d = A("d")
m = B("m")
i = C("i")
c = D("c")
n = E("n")
b = F("b")
a = B("a")
e = D("e")
f = B("f")
g = A("g")

d.q = g
d.x = g
m.t = n
m.s = f
m.v = b
m.y = a
m.x = i
i.t = d
i.v = a
i.r = c
c.u = i
c.x = m
c.q = a
c.t = a
c.y = e
n.p = b
b.y = c
b.s = c
b.t = c
b.r = i
b.o = d
b.u = g
a.t = n
a.s = f
a.y = f
a.v = b
a.x = i
e.u = i
e.x = m
e.q = a
e.y = c
e.t = f
f.t = n
f.s = m
f.v = b
f.y = a
f.x = i
g.q = d
g.x = d
assert c.y.q.v.r.t.q.q.q.x.txt == "d"