class A:
    def __init__(self, txt: str):
        self.s: F = None
        self.x: A = None
        self.u: B = None
        self.r: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: D = None
        self.s: E = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.z: F = None
        self.p: C = None
        self.s: E = None
        self.o: F = None
        self.t: F = None
        self.txt = txt

b = A("b")
n = B("n")
f = C("f")
c = D("c")
e = E("e")
j = F("j")
h = G("h")
g = A("g")
l = B("l")

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

class B:
    def __init__(self, txt: str):
        self.q: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: D = None
        self.s: E = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.z: F = None
        self.p: C = None
        self.s: E = None
        self.o: F = None
        self.t: F = None
        self.txt = txt

b = A("b")
n = B("n")
f = C("f")
c = D("c")
e = E("e")
j = F("j")
h = G("h")
g = A("g")
l = B("l")

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