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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.u: A = None
        self.txt = txt

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

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.u: A = None
        self.txt = txt

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

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

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