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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.o: C = None
        self.w: F = None
        self.p: D = None
        self.y: F = None
        self.s: D = None
        self.x: F = None
        self.txt = txt

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

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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.o: C = None
        self.w: F = None
        self.p: D = None
        self.y: F = None
        self.s: D = None
        self.x: F = None
        self.txt = txt

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

n.t = a
n.x = f
n.u = f
n.w = g
n.y = g
n.r = g
n.s = e
g.x = j
d.u = j
f.t = d
a.t = f
a.y = n
e.q = b
e.x = d
e.o = j
j.o = d
j.w = e
j.y = e
j.x = e
j.p = f
j.s = f
b.t = a
b.x = f
b.u = f
b.w = g
b.y = g
b.r = g
b.s = e
assert g.x.y.o.txt == "j"