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

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

class C:
    def __init__(self, txt: str):
        self.q: E = None
        self.t: B = None
        self.r: G = None
        self.txt = txt

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

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.q: E = None
        self.t: B = None
        self.r: G = None
        self.txt = txt

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

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

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

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

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

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