class A:
    def __init__(self, txt: str):
        self.z: B = None
        self.u: E = None
        self.s: F = None
        self.p: B = None
        self.v: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: C = None
        self.x: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: A = None
        self.p: D = None
        self.r: B = None
        self.q: A = None
        self.u: A = None
        self.o: A = None
        self.t: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: B = None
        self.y: B = None
        self.q: E = None
        self.w: E = None
        self.o: E = None
        self.r: C = None
        self.u: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: A = None
        self.o: C = None
        self.p: C = None
        self.v: A = None
        self.s: C = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.p: C = None
        self.x: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: A = None
        self.p: D = None
        self.r: B = None
        self.q: A = None
        self.u: A = None
        self.o: A = None
        self.t: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: B = None
        self.y: B = None
        self.q: E = None
        self.w: E = None
        self.o: E = None
        self.r: C = None
        self.u: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: A = None
        self.o: C = None
        self.p: C = None
        self.v: A = None
        self.s: C = None
        self.txt = txt

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

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

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

f.z = e
f.p = e
f.u = h
f.v = h
f.s = i
e.p = b
e.x = l
b.z = f
b.q = f
b.u = f
b.o = f
b.t = f
b.p = l
b.r = e
l.p = e
l.y = e
l.q = h
l.w = h
l.o = h
l.r = b
l.u = d
h.r = f
h.v = f
h.o = b
h.p = b
h.s = b
i.v = h
i.r = h
d.p = i
d.w = h
assert l.u.p.r.s.txt == "b"