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

class B:
    def __init__(self, txt: str):
        self.r: F = None
        self.t: F = None
        self.y: A = None
        self.p: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.p: D = None
        self.q: A = None
        self.z: G = None
        self.u: G = None
        self.t: D = None
        self.x: D = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.y: D = None
        self.z: E = None
        self.u: B = None
        self.o: G = None
        self.p: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: C = None
        self.o: G = None
        self.r: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.r: F = None
        self.t: F = None
        self.y: A = None
        self.p: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.p: D = None
        self.q: A = None
        self.z: G = None
        self.u: G = None
        self.t: D = None
        self.x: D = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.y: D = None
        self.z: E = None
        self.u: B = None
        self.o: G = None
        self.p: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: C = None
        self.o: G = None
        self.r: B = None
        self.txt = txt

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

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