class A:
    def __init__(self, txt: str):
        self.v: G = None
        self.s: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: A = None
        self.s: G = None
        self.t: A = None
        self.v: D = None
        self.w: A = None
        self.x: C = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.z: G = None
        self.t: E = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.q: D = None
        self.v: A = None
        self.t: B = None
        self.w: C = None
        self.o: G = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.y: A = None
        self.s: G = None
        self.t: A = None
        self.v: D = None
        self.w: A = None
        self.x: C = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.z: G = None
        self.t: E = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.q: D = None
        self.v: A = None
        self.t: B = None
        self.w: C = None
        self.o: G = None
        self.txt = txt

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

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