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

class B:
    def __init__(self, txt: str):
        self.s: E = None
        self.r: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.p: G = None
        self.u: H = None
        self.t: H = None
        self.r: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: D = None
        self.r: B = None
        self.y: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.y: F = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.s: E = None
        self.r: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.p: G = None
        self.u: H = None
        self.t: H = None
        self.r: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: D = None
        self.r: B = None
        self.y: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.y: F = None
        self.txt = txt

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

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

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